Skip to content

Enable use_join_disjunctions_push_down by default - #89313

Merged
alexey-milovidov merged 6 commits into
masterfrom
use_join_disjunctions_push_down-by-default
Jan 5, 2026
Merged

alexey-milovidov merged 6 commits into
masterfrom
use_join_disjunctions_push_down-by-default

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 31, 2025 •

Copy link
Copy Markdown
Member

This is follow-up for #84735

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The optimization use_join_disjunctions_push_down is enabled by default.

@clickhouse-gh

clickhouse-gh Bot commented Oct 31, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [26e1351]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_asan, db disk, old analyzer, 6/6) failure
test_projection_rebuild_with_required_columns/test.py::test_projection_rebuild_uses_only_required_columns FAIL cidb
Integration tests (amd_binary, 2/5) failure
test_projection_rebuild_with_required_columns/test.py::test_projection_rebuild_uses_only_required_columns FAIL cidb
AST fuzzer (arm_asan) failure
Logical error: Unexpected return type from A. Expected B. Got C. Action: (STID: 1611-3d19) FAIL cidb, issue
BuzzHouse (amd_debug) failure
Logical error: 'Inconsistent AST formatting: the query: (STID: 1941-1bfa) FAIL cidb, issue

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Oct 31, 2025
@yariks5s yariks5s self-assigned this Oct 31, 2025

@yariks5s yariks5s left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Before we enable this setting, we need to merge the pull request with this commit, that keeps the order of JOINs, which now can lead to unexpected behaviour for some cases.

Upd: that PR is merged

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Logical error: Join by layers expect the same number of ports for the left and the right pipeline. Actual: A and B.'

This is suspicious, could be relevant to this pr.

@yariks5s

Copy link
Copy Markdown
Member

I've managed to create a repro for it, https://fiddle.clickhouse.com/53932553-ff7d-4150-bb1f-ea5c2126a9c1

Working on it

@alexey-milovidov
alexey-milovidov merged commit 8817677 into master Jan 5, 2026
123 of 127 checks passed
@alexey-milovidov
alexey-milovidov deleted the use_join_disjunctions_push_down-by-default branch January 5, 2026 17:20
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 5, 2026
alexey-milovidov added a commit that referenced this pull request Feb 15, 2026
The `onlyDependsOnAvailableColumns` function in the partial predicate
push-down for JOINs did not check for `ARRAY_JOIN` nodes. This caused
predicates containing `arrayJoin` to be incorrectly pushed down below
a JOIN as a partial (speculative) filter, while the original filter
above the JOIN was kept. The `arrayJoin` therefore executed twice --
once in the pushed-down filter and once in the original filter --
producing duplicate rows.

The fix rejects any subgraph containing `ARRAY_JOIN` from being
considered for partial predicate push-down.

The bug was introduced in #84735 and exposed when the optimization
was enabled by default in #89313.

Closes #96398

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants