Hints are important supplementary to the SQL syntax in databases. You can use hints in a SQL statement to change the method in which the SQL statement is executed. LindormTable supports hints in SQL statements. For example, you can use hints in LindormTable SQL statements to manage multiple versions of data. This topic describes the syntax and scenarios of hints in LindormTable.

Usage notes

  • Hints are supported by LindormTable 2.3.1 and later. For more information about how to upgrade the version of LindormTable, see Upgrade the minor engine version of a Lindorm instance.
  • Hints can be used only after the INSERT, UPSERT, and SELECT keywords in SQL statements.
  • Hints cannot be used in SQL statements that are executed to perform complex queries, such as subqueries and group queries.
  • Hints do not support the PreparedStatement method.

Syntax

hintExpression ::= /*+ hintItems */

hintItems ::= hintItem (',' hintItem )*

hintItem ::= identifier ('(' hintOption ( ',' hintOption)* ')')?

hintOption ::= expression
Note
  • Hints are used in the /*+ hintItems */ format, in which hintItems indicates operation-specific hints. Multiple hintItems are separated by commas (,).
  • Hints are enclosed by /*+ and */.
Hints can be used only after the INSERT, UPSERT, and SELECT keywords in LindormTable SQL statements. The following examples show how to use hints in LindormTable SQL statements:
UPSERT /*+ _l_ts_(3000) */ INTO t_test_ts(c1, c3) VALUES (1, 'c3');
SELECT /*+ _l_versions_(1) */ c1, c3, c3_l_ts FROM t_test_ts;
Note Hints cannot be used after other keywords. For example, hints in the following statements are invalid: UPSERT INTO /*+ _l_ts_(3000) */ t_test_ts(c1, c3) VALUES (1, 'c3');.

Scenarios

You can use hints in the following scenarios: