diff --git a/explain-index-merge.md b/explain-index-merge.md index 0e68f80ffff58..623223fd03034 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. +> - 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. > > - Index Merge is not supported in [tempoaray tables](/temporary-tables.md) for now. > diff --git a/optimizer-fix-controls.md b/optimizer-fix-controls.md index e79f2613bb480..0fc68bc3fce56 100644 --- a/optimizer-fix-controls.md +++ b/optimizer-fix-controls.md @@ -70,3 +70,10 @@ SET SESSION tidb_opt_fix_control = '44262:ON,44389:ON'; - Possible values: `[0, 2147483647]` - This variable sets the threshold for the optimizer's heuristic strategy to select access paths. If the estimated rows for an access path (such as `Index_A`) is much smaller than that of other access paths (default `1000` times), the optimizer skips the cost comparison and directly selects `Index_A`. - `0` means to disable this heuristic strategy. + +### [`52869`](https://github.com/pingcap/tidb/issues/52869) New in v8.1.0 + +- Default value: `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.