pingcap / pingcap/tidb

planner: the estimation results of same predicate on different index statistics are not consistent

Open
#57,991 0 comments 0 reactions 1 assignee Claimed by @qw4990 View on GitHub
epic/cardinality-estimation report/customer sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
See the result below, the estimation result of the second query should be less than the first's, since predicates of the first is a sub-set of the second's.
But since we estimate them on different index statistics (IDX1 and IDX2), and statistics has a certain level of randomness, then finally their estimation results are not consistent:
![Image](https://github.com/user-attachments/assets/89e72fc1-325b-4853-8e66-e825987e9ae8)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.