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

update doc for IndexMerge GA #7348

Merged
merged 9 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions explain-index-merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ For the scan operation that is performed on a specific range of data, such as `I

> **Note:**
>
> At present, the `IndexMerge` feature is disabled by default in TiDB 4.0.0-rc.1. In addition, the currently supported scenarios of `IndexMerge` in TiDB 4.0 are limited to the disjunctive normal form (expressions connected by `or`). The conjunctive normal form (expressions connected by `and`) will be supported in later versions. Enable the `IndexMerge` in one of two ways:
> - The Index Merge feature is enabled by default from v5.4.0. That is, [`tidb_enable_index_merge`](/system-variables.md#tidb_enable_index_merge-new-in-v40) is `ON`.
>
> - Set `tidb_enable_index_merge=1`;
> - You can use the SQL hint [`USE_INDEX_MERGE`](/optimizer-hints.md#use_index_merget1_name-idx1_name--idx2_name-) to force the optimizer to apply Index Merge, regardless of the setting of `tidb_enable_index_merge`. To enable Index Merge when the filtering conditions contain expressions that cannot be pushed down, you must use the SQL hint [`USE_INDEX_MERGE`](/optimizer-hints.md#use_index_merget1_name-idx1_name--idx2_name-).
>
> - Use the SQL Hint [`USE_INDEX_MERGE`](/optimizer-hints.md#use_index_merget1_name-idx1_name--idx2_name-) in the query.
> - Index Merge supports only disjunctive normal form (expressions connected by `or`) and does not support conjunctive normal form (expressions connected by `and`).
>
> SQL Hint has a higher priority than system variables.
> - Index Merge is not supported in [tempoaray tables](/temporary-tables.md) for now.
4 changes: 2 additions & 2 deletions optimizer-hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ When multiple `USE_INDEX_MERGE` hints are made to the same table, the optimizer
This hint takes effect on strict conditions, including:

- If the query can select a single index scan in addition to full table scan, the optimizer does not select index merge.
- If the query is in an explicit transaction, and if the statements before this query has already written data, the optimizer does not select index merge.

## Hints that take effect in the whole query

Expand All @@ -262,7 +261,8 @@ In addition to this hint, setting the `tidb_enable_index_merge` system variable

> **Note:**
>
> `NO_INDEX_MERGE` has a higher priority over `USE_INDEX_MERGE`. When both hints are used, `USE_INDEX_MERGE` does not take effect.
> - `NO_INDEX_MERGE` has a higher priority over `USE_INDEX_MERGE`. When both hints are used, `USE_INDEX_MERGE` does not take effect.
> - For a subquery, `NO_INDEX_MERGE` only takes effect when it is placed at the outermost level of the subquery.

### USE_TOJA(boolean_value)

Expand Down
10 changes: 9 additions & 1 deletion system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,17 @@ Constraint checking is always performed in place for pessimistic transactions (d
### tidb_enable_index_merge <span class="version-mark">New in v4.0</span>

- Scope: SESSION | GLOBAL
- Default value: `OFF`
- Default value: `ON`
- This variable is used to control whether to enable the index merge feature.

> **Note:**
>
> - After upgrading a TiDB cluster from versions earlier than v4.0.0 to v5.4.0 or later, this variable is disabled by default to prevent performance regression due to changes of execution plans.
>
> - After upgrading a TiDB cluster from v4.0.0 or later to v5.4.0 or later, this variable remains the setting before the upgrade.
>
> - Since v5.4.0, for a newly deployed TiDB cluster, this variable is enabled by default.

### tidb_enable_list_partition <span class="version-mark">New in v5.0</span>

> **Warning:**
Expand Down