Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL statement, system variables: update expression indexes #6185

Prev Previous commit
Next Next commit
revise translations
  • Loading branch information
en-jin19 committed Aug 18, 2021
commit acba8e9bda07082ae5a0fede8237634b5a59df37
2 changes: 1 addition & 1 deletion sql-statements/sql-statement-create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ The global variables associated with the `CREATE INDEX` statement are `tidb_ddl_
* Descending indexes are not supported (similar to MySQL 5.7).
* Adding the primary key of the `CLUSTERED` type to a table is not supported. For more details about the primary key of the `CLUSTERED` type, refer to [clustered index](/clustered-indexes.md).
* Expression indexes are incompatible with the views. When you query contents via a view, the expression index can not be used at the same time.
* There are compatibility issues between expression indexes and bindings. When an expression in an expression index has constants, the binding created for the corresponding query expands its scope. For example, suppose the expression in the expression index is `a+1`, and the corresponding query condition is `a+1 > 2`. In this case, the binding is `a+? > ?`, which means that the queries such as `a+2 > 2` are also forced to select expression indexes. It results in a poor execution plan. Besides, this also affects the baseline capturing and baseline evolution belonging to SQL Plan Management.
* There are compatibility issues between expression indexes and bindings. When an expression in an expression index has constants, the binding created for the corresponding query expands its scope. For example, suppose the expression in the expression index is `a+1`, and the corresponding query condition is `a+1 > 2`. In this case, the binding is `a+? > ?`, which means that the queries such as `a+2 > 2` are also forced to use the expression index. It results in a poor execution plan. Besides, this also affects the baseline capturing and baseline evolution belonging to SQL Plan Management.

## See also

Expand Down
2 changes: 1 addition & 1 deletion system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ Constraint checking is always performed in place for pessimistic transactions (d

- Scope: SESSION | GLOBAL
- Default value: `OFF`
- This variable is used to determine whether to involve the `AUTO_INCREMENT` columns when creating a generated column or an expression index.
- This variable is used to determine whether can include the `AUTO_INCREMENT` columns when creating a generated column or an expression index.

### tidb_enable_cascades_planner

Expand Down