Setting hints in annotated queries
The hints in a directed query's annotated query provide the optimizer with instructions how to execute an input query.
The hints in a directed query's annotated query provide the optimizer with 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.
- :v and its alias IGNORECONSTANT marks predicate string constants that you want the optimizer to ignore when it decides whether to use a directed query for a given input query. For details, see Ignoring constants in directed queries.
- :c hints mark predicate constants that must not be ignored.
- VERBATIM enforces execution of an annotated query exactly as written.
Other hints in annotated queries such as DIRECT or LABEL have no effect.
You can use hints in a vsql query the same as in an annotated query, with two exceptions: :v (IGNORECONSTANT) and VERBATIM.