pingcap / pingcap/tidb

planner: assumed data distribution of out-of-range estimation might not be correct in some cases

Open
#57,975 0 comments 0 reactions 0 assignees View on GitHub
affects-7.5 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
Currently, we assumes all newly added data are uniformly distributed, but this assumption might not be correct in some cases.

![Image](https://github.com/user-attachments/assets/5bcda0e7-40ed-402d-9b12-8aa812178483)

![Image](https://github.com/user-attachments/assets/d132094a-247b-4cc0-919d-ec16393d0333)

Below is a real bad case from one customer:
![Image](https://github.com/user-attachments/assets/92fd0650-9cc2-4514-8630-fb05900a4bf5)

The data in the predicate is out-of-range, and the estimation result has a large error.

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.