planner: cardinality estimation on TPCC customer is not accurate enough #39636
Labels
epic/cardinality-estimation
the optimizer cardinality estimation
sig/planner
SIG: Planner
type/enhancement
The issue or PR belongs to an enhancement.
Enhancement
replayer.zip
The estimation result of the composite condition
c_w_id=? and c_d_id=? and c_last=?
is over-estimated and causes a wrong plan(should use IndexLookUp here).The root cause is our current exponential estimation algorithm(https://github.com/pingcap/tidb/blob/master/statistics/index.go#L324) cannot fit TPCC workload(
Customer
) well.This algorithm assume all input columns have relatively high correlation, but
c_w_id
,c_d_id
andc_last
break this assumption.If the cardinality is correct, the planner can select the right plan:
The text was updated successfully, but these errors were encountered: