Commit d3c3bfe
committed
Add built-in operator statistics providers
Adds a set of default StatisticsProvider implementations that cover the
most common physical operators:
- FilterStatisticsProvider: selectivity-based row count, reuses the same
pre-enhanced child statistics, with post-filter NDV adjustment
- ProjectionStatisticsProvider: column mapping through projections
- PassthroughStatisticsProvider: passthrough for cardinality-preserving operators
(Sort, Repartition, Window, etc.) via CardinalityEffect
- AggregateStatisticsProvider: NDV-product estimation for GROUP BY,
delegates for Partial mode and multiple grouping sets (apache#20926)
- JoinStatisticsProvider: NDV-based join output estimation (hash, sort-merge,
nested-loop, cross) with join-type-aware cardinality bounds and correct
key-column NDV lookup
- LimitStatisticsProvider: caps output at the fetch limit (local and global)
- UnionStatisticsProvider: sums input row counts
- DefaultStatisticsProvider: fallback to partition_statistics(None)1 parent 84d861a commit d3c3bfe
3 files changed
+1527
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
0 commit comments