Repository navigation
fix: use session statistics registry in dfbench reports - #25570
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25570 +/- ##
==========================================
- Coverage 82.70% 82.70% -0.01%
==========================================
Files 1147 1147
Lines 447631 447668 +37
Branches 447631 447668 +37
==========================================
+ Hits 370222 370250 +28
- Misses 54921 54927 +6
- Partials 22488 22491 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
cc @kosiew, as you gave a great review on the original PR. It's a trival change that should take no more than 2 mins to review. |
kosiew
left a comment
There was a problem hiding this comment.
Thanks for working on this. The implementation addresses the registry mismatch, but the behavior change itself is not covered by a regression test yet.
kosiew
left a comment
There was a problem hiding this comment.
Thanks for adding the regression test. It now verifies the user-visible behavior by using a distinguishing session statistics provider and asserting that dfbench reports that estimate.
|
Thanks @kosiew and @asolimando! |
## Which issue does this PR close? - Closes apache#25571. ## Rationale for this change `StatisticsRegistry::default_with_builtin_providers()` registers providers that are not the default estimation and that duplicate or replace what the operators already do in `statistics_from_inputs`. They can make estimates worse (TPC-H Q14: 14.73 billion rows instead of 73,650, see apache#25570), and fixes in the operators do not reach their users. Estimation improvements belong in the operators; `StatisticsRegistry` stays as the extension point for user-defined providers. ## What changes are included in this PR? - `default_with_builtin_providers()` and all seven bundled providers are deprecated. Their code is unchanged. - `statistics_registry.slt` and the `join_reorder` example use user-defined providers instead of bundled ones. - `dfbench statistics` reports the operators' own estimates instead of the bundled providers' estimates. Follow-ups: moving the Filter distinct count survival model into `FilterExec` (apache#26052); multi-key join estimation is tracked in apache#21583. ## What is the testing strategy for this PR? `statistics_registry.slt` passes unchanged; the `join_reorder` example still flips the build side. ## Are there any user-facing changes? Deprecations only, see the 56.0.0 upgrade guide. ---- Disclaimer: I used AI to assist in the code generation, I have manually reviewed the output and it matches my intention and understanding. --------- Co-authored-by: Gabriel <45515538+gabotechs@users.noreply.github.com>
Which issue does this PR close?
Part of #8227.
Rationale for this change
dfbench statisticsunconditionally enables built-in statistics providers, so its estimates can differ from those used by the session. In TPC-H SF1 Q14, it reports 14.73 billion rows instead of 73,650 for a join that produces 75,983 rows.Unrelated to this PR, but it's pretty weird how the built-in providers are not actually built-in unless explicitly enabled, and it's also weird how they can override the actually built-in code in each operator producing different results. It seems like there's different pieces of code with overlapping intentions and different implementation.
What changes are included in this PR?
Capture estimates using the session's registry, matching
EXPLAIN ANALYZE. An unconfigured session falls back to operator statistics.What is the testing strategy for this PR?
Are there any user-facing changes?
CLI estimates now respect the session's statistics configuration.