Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(query): optimize min/max aggregation use accurate column stats #16270

Merged
merged 8 commits into from
Aug 19, 2024

Conversation

sundy-li
Copy link
Member

@sundy-li sundy-li commented Aug 17, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Min/Max aggregation will be replaced by accurate column stat result in query without group by and filters.

query T
explain select 5, count(), min(number), max(ts), min(money), 4 from t;
----
EvalScalar
├── output columns: [min(number) (#6), max(ts) (#7), min(money) (#8), count() (#5), 5 (#9), 4 (#10)]
├── expressions: [5, 4]
├── estimated rows: 1.00
└── EvalScalar
    ├── output columns: [min(number) (#6), max(ts) (#7), min(money) (#8), count() (#5)]
    ├── expressions: [0, '2024-01-01 00:33:19.000000', 0.00, 3000]
    ├── estimated rows: 1.00
    └── DummyTableScan

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Aug 17, 2024
@sundy-li sundy-li requested a review from dantengsky August 17, 2024 13:53
@sundy-li sundy-li marked this pull request as ready for review August 17, 2024 13:53
@sundy-li sundy-li requested a review from Dousir9 August 19, 2024 01:02
Copy link
Member

@Dousir9 Dousir9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@sundy-li sundy-li added this pull request to the merge queue Aug 19, 2024
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Aug 19, 2024
@BohuTANG BohuTANG merged commit bfb919d into databendlabs:main Aug 19, 2024
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants