Skip to content

Backport #98776 to 25.12: Fix detecting set skip index usefulness with OR with false (i.e. or(x, 0)) predicate - #98834

Merged
azat merged 1 commit into
25.12from
backport/25.12/98776
Mar 5, 2026
Merged

azat merged 1 commit into
25.12from
backport/25.12/98776

Conversation

@robot-clickhouse-ci-2

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 commented Mar 5, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #98776
Cherry-pick pull-request #98833

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job


Note

Medium Risk
Changes the set skip-index usefulness heuristic for OR predicates, which can alter when data-skipping indices are applied and thus affect query planning/performance; behavior is covered by a new regression test but still impacts a core execution path.

Overview
Fixes MergeTreeIndexConditionSet::checkDAGUseless so or(..., 0) no longer prevents detecting a predicate as useless for a set skip index by ignoring constant-false OR children (the identity element) during the usefulness scan.

Adds a stateless regression test (04027_set_index_or_non_indexed_column) asserting that or(non_indexed_predicate, 0) does not use the set index (and fails under force_data_skipping_indices), while b = ... and or(b = ..., 0) still do.

Written by Cursor Bugbot for commit 6dca949. This will update automatically on new commits. Configure here.

Version info

  • Merged into: 25.12.9.18

…h OR with false (i.e. or(x, 0)) predicate
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Mar 5, 2026
@clickhouse-gh

clickhouse-gh Bot commented Mar 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [6dca949]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_asan, db disk, old analyzer, 1/6) failure
test_storage_delta/test.py::test_concurrent_queries[True] FAIL cidb
test_storage_delta/test.py::test_writes_spark_compatibility FAIL cidb
test_storage_delta/test.py::test_write_limits[False-False] FAIL cidb
test_storage_delta/test.py::test_write_limits[False-True] FAIL cidb
test_storage_delta/test.py::test_write_limits[True-False] FAIL cidb
test_storage_delta/test.py::test_write_limits[True-True] FAIL cidb
test_storage_delta/test.py::test_column_mapping_id FAIL cidb
test_storage_delta/test.py::test_subcolumns[] FAIL cidb
test_storage_delta/test.py::test_subcolumns[name] FAIL cidb
test_storage_delta/test.py::test_subcolumns_2[] FAIL cidb
9 more test cases not shown
Integration tests (amd_asan, db disk, old analyzer, 3/6) failure
test_throttling/test.py::test_read_throttling[user_remote_throttling] FAIL cidb

@azat
azat merged commit 88ce6a0 into 25.12 Mar 5, 2026
32 of 34 checks passed
@azat
azat deleted the backport/25.12/98776 branch March 5, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants