planner: consider partition pruning when estimating partition table row counts
Open
component/statistics
component/tablepartition
epic/cardinality-estimation
sig/planner
type/enhancement
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
As you can see below, since the estimator doesn't consider partition pruning, the below two `IndexRangeScans` have the same `estRows`, but actually, they vary a lot:

We can optimize it by using corresponding partition stats only to estimate or multiplying the result by `partitionRows / totalRows`.
Contributor guide
Assessment
This issue has not been assessed yet.