diff --git a/sql-statements/sql-statement-create-index.md b/sql-statements/sql-statement-create-index.md index 19d4efecc512c..b54b628cde16a 100644 --- a/sql-statements/sql-statement-create-index.md +++ b/sql-statements/sql-statement-create-index.md @@ -111,6 +111,18 @@ Query OK, 0 rows affected (0.31 sec) ## Expression index +> **Note:** +> +> Expression index is still an experimental feature. It is **NOT** recommended that you use it in the production environment. + +To use this feature, make the following setting in [TiDB Configuration File](/tidb-configuration-file.md#allow-expression-index-new-in-v400): + +{{< copyable "sql" >}} + +```sql +allow-expression-index = true +``` + TiDB can build indexes not only on one or more columns in a table, but also on an expression. When queries involve expressions, expression indexes can speed up those queries. Take the following query as an example: diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 053f12ebfbcfc..291f3a6812c9a 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -612,4 +612,9 @@ For pessimistic transaction usage, refer to [TiDB Pessimistic Transaction Mode]( ## experimental -The `experimental` section, introduced in v3.1.0, describes configurations related to the experimental features of TiDB. Currently, this section has no configuration item. +The `experimental` section, introduced in v3.1.0, describes configurations related to the experimental features of TiDB. + +### `allow-expression-index` New in v4.0.0 + +- Determines whether to create the expression index. +- Default value: false \ No newline at end of file