Skip to content

feat(binder): improve histogram-based filter and join statistics propagation#19906

Open
forsaken628 wants to merge 16 commits into
databendlabs:mainfrom
forsaken628:fix-histogram2
Open

feat(binder): improve histogram-based filter and join statistics propagation#19906
forsaken628 wants to merge 16 commits into
databendlabs:mainfrom
forsaken628:fix-histogram2

Conversation

@forsaken628
Copy link
Copy Markdown
Collaborator

@forsaken628 forsaken628 commented May 22, 2026

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

Summary

  • derive comparison selectivity and column statistics from histograms, including row scaling for restricted histogram ranges
  • apply value constraints together so multi-predicate filters can propagate column bounds/statistics without assuming independent columns
  • add join cardinality/statistics golden coverage driven by SQL plus table statistics and histogram JSON
  • group join golden cases by the actual join.rs behavior branches, covering cardinality formulas, join-key stat propagation, histogram rebuild/drop behavior, semi joins, ASOF
    joins, and internal RightSingle

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 May 22, 2026
@forsaken628 forsaken628 marked this pull request as ready for review May 26, 2026 01:01
@forsaken628 forsaken628 added the ci-benchmark-cloud Benchmark: run only cloud tests for tpch/hits label May 26, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aae7d67d37

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/sql/src/planner/optimizer/ir/stats/selectivity.rs
@github-actions
Copy link
Copy Markdown
Contributor

Docker Image for PR

  • tag: pr-19906-e77fa5a-1779762135

note: this image tag is only available for internal use.

@github-actions
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-benchmark-cloud Benchmark: run only cloud tests for tpch/hits pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants