planner: fix the inappropriate out-of-range range estimation rule #20989
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
priority/release-blocker
This issue blocks a release. Please solve it ASAP.
type/enhancement
The issue or PR belongs to an enhancement.
Milestone
Development Task
When estimating the number of rows for ranges in
GetColumnRowCount
, if the range is out-of-range, for example, the range's upper bound is less than the minimum value in statistics, TiDB usesoutOfRangeEQSelectivity
, but this is inappropriate sinceoutOfRangeEQSelectivity
is created for point estimation instead of range estimation.It's better to create a new function
outOfRangeIntervalSelectivity
for range estimation.This function
outOfRangeIntervalSelectivity
can be implemented as:The text was updated successfully, but these errors were encountered: