diff --git a/optimizer-hints.md b/optimizer-hints.md index 97f2946a8b38d..752f2b08ea0ff 100644 --- a/optimizer-hints.md +++ b/optimizer-hints.md @@ -186,6 +186,16 @@ The `AGG_TO_COP()` hint tells the optimizer to push down the aggregate operation select /*+ AGG_TO_COP() */ sum(t1.a) from t t1; ``` +### LIMIT_TO_COP() + +The `LIMIT_TO_COP()` hint tells the optimizer to push down the `Limit` and `TopN` operators in the specified query block to the coprocessor. If the optimizer does not perform such an operation, it is recommended to use this hint. For example: + +{{< copyable "sql" >}} + +```sql +SELECT /*+ LIMIT_TO_COP() */ * FROM t WHERE a = 1 AND b > 10 ORDER BY c LIMIT 1; +``` + ### READ_FROM_STORAGE(TIFLASH[t1_name [, tl_name ...]], TIKV[t2_name [, tl_name ...]]) The `READ_FROM_STORAGE(TIFLASH[t1_name [, tl_name ...]], TIKV[t2_name [, tl_name ...]])` hint tells the optimizer to read specific table(s) from specific storage engine(s). Currently, this hint supports two storage engine parameters - `TIKV` and `TIFLASH`. If a table has an alias, use the alias as the parameter of `READ_FROM_STORAGE()`; if the table does not has an alias, use the table's original name as the parameter. For example: diff --git a/sql-statements/sql-statement-create-sequence.md b/sql-statements/sql-statement-create-sequence.md index 0ad50d427b79f..a723c02d27842 100644 --- a/sql-statements/sql-statement-create-sequence.md +++ b/sql-statements/sql-statement-create-sequence.md @@ -47,7 +47,6 @@ CREATE [TEMPORARY] SEQUENCE [IF NOT EXISTS] sequence_name [ START [ WITH | = ] start ] [ CACHE [=] cache | NOCACHE | NO CACHE] [ CYCLE | NOCYCLE | NO CYCLE] - [ ORDER | NOORDER | NO ORDER] [table_options] ``` @@ -62,7 +61,6 @@ CREATE [TEMPORARY] SEQUENCE [IF NOT EXISTS] sequence_name | `START` | `MINVALUE` or `MAXVALUE`| Specifies the initial value of a sequence. When `INCREMENT` > `0`, the default value is `MINVALUE`. When `INCREMENT` < `0`, the default value is `MAXVALUE`. | | `CACHE` | `1000` | Specifies the local cache size of a sequence in TiDB. | | `CYCLE` | `NO CYCLE` | Specifies whether a sequence restarts from the minimum value (or maximum for the descending sequence). When `INCREMENT` > `0`, the default value is `MINVALUE`. When `INCREMENT` < `0`, the default value is `MAXVALUE`. | -| `ORDER` | `NO ORDER` | TiDB currently does not support the `ORDER` option and provides only syntax compatibility for it. | ## `SEQUENCE` function