There is a cleanup task for several things in the optimizer.
- Ensure that 0 <= selectivity <= 1
- Ensure that selectivity calculation doesn't return too few row
- Calculate and use index only cost when appropriate.
- Examine and improve cost calculation in the optimizer for:
- Ensure that filter cost calculation also include index only cost and compare with WHERE
- table scans
- hash and joins and cached full joins
- group by
- Adjusted Range_rowid_filter_cost_info lookup cost for very small arrays.
- Limit calculated rows to the number of rows in the table
- Ensure that test_quick_select doesn't return more rows than in the table
A lot of other optimizer related issues, documented at