Setting Hints in Annotated Queries
The hints in a directed query's annotated query provide the Vertica optimizer instructions how to execute an input query. Annotated queries support the following hints:
- Join hints specify join order, join type, and join data distribution:
SYNTACTIC_JOIN
,DISTRIB
,JTYPE
,UTYPE
. - Table hints specify which projections to include and exclude in the query plan:
PROJS
,SKIP_PROJS
. IGNORECONST
is supported for a directed query's input and annotated queries. For more information, see Ignoring Constants in Directed QueriesVERBATIM
enforces execution of an annotated query exactly as written.
Other hints in annotated queries such as DIRECT
or LABEL
are ignored.
You can use hints in a vsql query the same as in an annotated query, with two exceptions: IGNORECONST
and VERBATIM
are invalid for use in vsql. For general information about using hints, see Hints in the SQL Reference Manual.