From 5db9fd8f97073e455964cb56a40957366f2b6753 Mon Sep 17 00:00:00 2001 From: time-and-fate <25057648+time-and-fate@users.noreply.github.com> Date: Thu, 25 Jun 2026 01:35:53 +0800 Subject: [PATCH 1/3] update optimizer fix control 52869 default value --- optimizer-fix-controls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimizer-fix-controls.md b/optimizer-fix-controls.md index b75d1033235be..9382625886f0e 100644 --- a/optimizer-fix-controls.md +++ b/optimizer-fix-controls.md @@ -103,7 +103,7 @@ SET SESSION tidb_opt_fix_control = '44262:ON,44389:ON'; ### [`52869`](https://github.com/pingcap/tidb/issues/52869) New in v8.1.0 -- Default value: `OFF` +- Default value: `ON`. Before v8.5.7, the default value is `OFF`; starting from v8.5.7, it is `ON`. - Possible values: `ON`, `OFF` - As stated in the **Note** of [Explain Statements Using Index Merge](/explain-index-merge.md#examples), if the optimizer can choose the single index scan method (other than full table scan) for a query plan, the optimizer will not automatically use index merge. - You can remove this limitation by enabling this fix control. Removing this limitation enables the optimizer to choose index merge automatically in more queries, but might cause the optimizer to ignore the optimal execution plans. Therefore, it is recommended to conduct sufficient tests on actual use cases before removing this limitation to make sure that it will not cause performance regressions. From 7bf65ff4c972746c909dbc832d8e19adf7074a2e Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Thu, 25 Jun 2026 15:50:30 +0800 Subject: [PATCH 2/3] Update optimizer-fix-controls.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- optimizer-fix-controls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimizer-fix-controls.md b/optimizer-fix-controls.md index 9382625886f0e..dbe7e9126885d 100644 --- a/optimizer-fix-controls.md +++ b/optimizer-fix-controls.md @@ -103,7 +103,7 @@ SET SESSION tidb_opt_fix_control = '44262:ON,44389:ON'; ### [`52869`](https://github.com/pingcap/tidb/issues/52869) New in v8.1.0 -- Default value: `ON`. Before v8.5.7, the default value is `OFF`; starting from v8.5.7, it is `ON`. +- Default value: `ON`. Before v8.5.7, the default value is `OFF`. - Possible values: `ON`, `OFF` - As stated in the **Note** of [Explain Statements Using Index Merge](/explain-index-merge.md#examples), if the optimizer can choose the single index scan method (other than full table scan) for a query plan, the optimizer will not automatically use index merge. - You can remove this limitation by enabling this fix control. Removing this limitation enables the optimizer to choose index merge automatically in more queries, but might cause the optimizer to ignore the optimal execution plans. Therefore, it is recommended to conduct sufficient tests on actual use cases before removing this limitation to make sure that it will not cause performance regressions. From b8f4356170d74fa84c5abf28fcaf5e2616d036ad Mon Sep 17 00:00:00 2001 From: time-and-fate <25057648+time-and-fate@users.noreply.github.com> Date: Fri, 3 Jul 2026 19:43:10 +0800 Subject: [PATCH 3/3] clarify index merge limitation behavior for fix control 52869 Update optimizer-fix-controls.md and explain-index-merge.md to describe the ON/OFF behavior of 52869 and the v8.5.7 default value change, replacing the previous 'limitation exists by default' wording. Co-Authored-By: Claude Opus 4.8 (1M context) --- explain-index-merge.md | 2 +- optimizer-fix-controls.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/explain-index-merge.md b/explain-index-merge.md index 4fd15aa1ce63e..5c63244a137a4 100644 --- a/explain-index-merge.md +++ b/explain-index-merge.md @@ -92,7 +92,7 @@ When using the intersection-type index merge to access tables, the optimizer can > > - 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-). > -> - If the optimizer can choose the single index scan method (other than full table scan) for a query plan, the optimizer will not automatically use index merge. For the optimizer to use index merge, you need to use the optimizer hint. Starting from v8.1.0, you can remove this limitation by setting [Optimizer Fix Control 52869](/optimizer-fix-controls.md#52869-new-in-v810). Removing this limitation enables the optimizer to choose index merge automatically in more queries, but might cause the optimizer to ignore the optimal execution plans. Therefore, it is recommended to conduct sufficient tests on actual use cases before removing this limitation to make sure that it will not cause performance regressions. +> - When [Optimizer Fix Control 52869](/optimizer-fix-controls.md#52869-new-in-v810) is set to `OFF`, if the optimizer can choose the single index scan method (other than full table scan) for a query plan, the optimizer will not automatically use index merge. To use index merge, you need to use the optimizer hint. Starting from v8.1.0, you can remove this limitation by enabling this fix control; starting from v8.5.7, its default value is changed to `ON`, and the preceding limitation is removed by default. This enables the optimizer to choose index merge automatically in more queries. > > - Index Merge is not supported in [temporary tables](/temporary-tables.md) for now. > diff --git a/optimizer-fix-controls.md b/optimizer-fix-controls.md index dbe7e9126885d..c4251f75f5707 100644 --- a/optimizer-fix-controls.md +++ b/optimizer-fix-controls.md @@ -105,8 +105,8 @@ SET SESSION tidb_opt_fix_control = '44262:ON,44389:ON'; - Default value: `ON`. Before v8.5.7, the default value is `OFF`. - Possible values: `ON`, `OFF` -- As stated in the **Note** of [Explain Statements Using Index Merge](/explain-index-merge.md#examples), if the optimizer can choose the single index scan method (other than full table scan) for a query plan, the optimizer will not automatically use index merge. -- You can remove this limitation by enabling this fix control. Removing this limitation enables the optimizer to choose index merge automatically in more queries, but might cause the optimizer to ignore the optimal execution plans. Therefore, it is recommended to conduct sufficient tests on actual use cases before removing this limitation to make sure that it will not cause performance regressions. +- When this fix control is set to `OFF`, if the optimizer can choose the single index scan method (other than full table scan) for a query plan, the optimizer will not automatically use index merge. For more details, see the **Note** in [Explain Statements Using Index Merge](/explain-index-merge.md#examples). +- When this fix control is set to `ON`, the preceding limitation is removed, and the optimizer can choose index merge automatically in more queries. However, due to factors such as inaccurate cost estimation, the optimizer might miss the otherwise optimal execution plan. ### [`54337`](https://github.com/pingcap/tidb/issues/54337) New in v8.3.0