`tidb_opt_ordering_index_selectivity_threshold` should also be valid for clustered index
Open
affects-7.1
affects-7.5
affects-8.1
report/customer
sig/planner
type/enhancement
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
If a table has a clustered index as an option of order index, the choice between the clustered index and another index using selection condition is not controlled by the variable `tidb_opt_ordering_index_selectivity_threshold`. It'd be better to support this case, to avoid choosing bad plan for the same case (but for clustered index) as described in https://github.com/pingcap/tidb/issues/42060.
Contributor guide
Assessment
This issue has not been assessed yet.