Skip to content

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

Merged
clickhouse-gh[bot] merged 1 commit into
26.1from
backport/26.1/98776
Mar 5, 2026
Merged

clickhouse-gh[bot] merged 1 commit into
26.1from
backport/26.1/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 #98835

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 set skip-index applicability logic for OR expressions, which can alter when data-skipping indices are used and affect query planning/performance. Includes a new regression test to catch incorrect index usage decisions.

Overview
Fixes set skip-index usefulness detection in MergeTreeIndexSet by treating constant false children of or(...) as identity elements during checkDAGUseless, preventing or(non_indexed_predicate, 0) from incorrectly making the overall predicate appear index-usable.

Adds a stateless regression test (04027_set_index_or_non_indexed_column) asserting the index is not forced/used for or(a = 5, 0) when a is not indexed, while still being usable for b = 5 and or(b = 5, 0).

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

Version info

  • Merged into: 26.1.5.11

… 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 [8115781]

Summary: ✅

@clickhouse-gh
clickhouse-gh Bot merged commit 3b4b6d5 into 26.1 Mar 5, 2026
33 of 34 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the backport/26.1/98776 branch March 5, 2026 14:45
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