Skip to content

fix: retain selectivity from supported AND conditions - #27832

Open
kumarUjjawal wants to merge 1 commit into
apache:mainfrom
kumarUjjawal:kumarUjjawal/datafusion-25610-candidates
Open

kumarUjjawal wants to merge 1 commit into
apache:mainfrom
kumarUjjawal:kumarUjjawal/datafusion-25610-candidates

Conversation

@kumarUjjawal

Copy link
Copy Markdown
Contributor

Important

Fork CI is enabled. Fork CI setup guide

Which issue does this PR close?

Closes #25612

Rationale for this change

Adding AND p_type LIKE '%BRASS%' to p_size = 15 raised the TPC-H SF1 estimate from 4,000 to 40,000 rows for a query that returns 747.

What changes are included in this PR?

Analyze supported conditions together and use the smallest string or IN estimate per column so each column's NULL share is counted once.

What is the testing strategy for this PR?

  • Parquet SQL logic regression in parquet_statistics.slt
  • Filter unit tests for residual selectivity, distinct counts, and shared NULL rejection
  • Extended workspace suite and TPC-H SF1 reproduction

Are there any user-facing changes?

The mixed TPC-H filter now estimates 800 rows.

@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) physical-plan Changes to the physical-plan crate labels Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retain selectivity from supported AND conjuncts

1 participant