Skip to content

feat(query): rewrite outer join exclusion filters as anti joins#20189

Open
forsaken628 wants to merge 3 commits into
databendlabs:mainfrom
forsaken628:optimize-q78-outer-to-anti
Open

feat(query): rewrite outer join exclusion filters as anti joins#20189
forsaken628 wants to merge 3 commits into
databendlabs:mainfrom
forsaken628:optimize-q78-outer-to-anti

Conversation

@forsaken628

@forsaken628 forsaken628 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

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

Summary

  • Rewrite LEFT/RIGHT OUTER JOIN exclusion patterns into anti joins when IS NULL targets a regular equi-join key on the null-extended side.
  • Preserve residual filters and output schemas by reconstructing removed-side columns as typed NULL values; exclude nullable payload tests and null-safe join conditions.
  • Harden EvalScalar behavior with correct physical column pruning, dependency-safe merging, constant-overwrite preservation, and derived statistics without stale ColumnStat,
    TopN, or CMS data.
  • Add SQL-driven optimizer goldens, SQL logic coverage for LEFT/RIGHT JOIN and NULL semantics, focused EvalScalar unit tests, and optimizer rule-testing guidance.

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 Jul 22, 2026
@forsaken628
forsaken628 marked this pull request as ready for review July 24, 2026 02:28
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

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.

1 participant