From 86418d0bb35955c79706161d3b5df17606f71e90 Mon Sep 17 00:00:00 2001 From: Joyinqin Date: Fri, 18 Dec 2020 16:50:39 +0800 Subject: [PATCH 1/3] Revert "*: remove expression index out of experimental feature." --- sql-statements/sql-statement-create-index.md | 12 ++++++++++++ tidb-configuration-file.md | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-create-index.md b/sql-statements/sql-statement-create-index.md index 19d4efecc512c..954e56ea3193e 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:** +> +> This feature is experimental. It is **NOT** recommended to use this feature in the production environment. + +If you need to use this feature, set the following in [TiDB Configuration File](tidb-configuration-file.md#allow-expression-index-new-in-400): + +{{< 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..e6fd95227ab3f 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 allow creating the expression index. +- Default value: false \ No newline at end of file From 14258d7d4f6e824c4e63b5166be282261af47829 Mon Sep 17 00:00:00 2001 From: Joyinqin Date: Fri, 18 Dec 2020 17:00:50 +0800 Subject: [PATCH 2/3] Update sql-statement-create-index.md --- sql-statements/sql-statement-create-index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-statements/sql-statement-create-index.md b/sql-statements/sql-statement-create-index.md index 954e56ea3193e..603022586b814 100644 --- a/sql-statements/sql-statement-create-index.md +++ b/sql-statements/sql-statement-create-index.md @@ -115,7 +115,7 @@ Query OK, 0 rows affected (0.31 sec) > > This feature is experimental. It is **NOT** recommended to use this feature in the production environment. -If you need to use this feature, set the following in [TiDB Configuration File](tidb-configuration-file.md#allow-expression-index-new-in-400): +If you need to use this feature, set the following in [TiDB Configuration File](tidb-configuration-file.md#allow-expression-index-new-in-v400): {{< copyable "sql" >}} From 4e74496dd291ff94ed6ac9e96ce527d07759195d Mon Sep 17 00:00:00 2001 From: Joyinqin Date: Fri, 18 Dec 2020 17:07:51 +0800 Subject: [PATCH 3/3] fix the broken link --- sql-statements/sql-statement-create-index.md | 4 ++-- tidb-configuration-file.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sql-statements/sql-statement-create-index.md b/sql-statements/sql-statement-create-index.md index 603022586b814..b54b628cde16a 100644 --- a/sql-statements/sql-statement-create-index.md +++ b/sql-statements/sql-statement-create-index.md @@ -113,9 +113,9 @@ Query OK, 0 rows affected (0.31 sec) > **Note:** > -> This feature is experimental. It is **NOT** recommended to use this feature in the production environment. +> Expression index is still an experimental feature. It is **NOT** recommended that you use it in the production environment. -If you need to use this feature, set the following in [TiDB Configuration File](tidb-configuration-file.md#allow-expression-index-new-in-v400): +To use this feature, make the following setting in [TiDB Configuration File](/tidb-configuration-file.md#allow-expression-index-new-in-v400): {{< copyable "sql" >}} diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index e6fd95227ab3f..291f3a6812c9a 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -616,5 +616,5 @@ The `experimental` section, introduced in v3.1.0, describes configurations relat ### `allow-expression-index` New in v4.0.0 -- Determines whether to allow creating the expression index. +- Determines whether to create the expression index. - Default value: false \ No newline at end of file