⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

25.8.15 Backport of #87303 - Fix condition not being moved to PREWHERE in case there is a row policy (version 2)#1345

Merged
zvonand merged 5 commits intoreleases/25.8.15from
backports/25.8.15/87303
Feb 2, 2026
Merged

25.8.15 Backport of #87303 - Fix condition not being moved to PREWHERE in case there is a row policy (version 2)#1345
zvonand merged 5 commits intoreleases/25.8.15from
backports/25.8.15/87303

Conversation

@zvonand
Copy link
Collaborator

@zvonand zvonand commented Jan 27, 2026

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fixed move-to-prewhere optimization, which did not work in the presence of row policy (ClickHouse#87303 by @KochetovNicolai)

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • Tiered Storage (2h)

@github-actions
Copy link

github-actions bot commented Jan 27, 2026

Workflow [PR], commit [d0e8ec2]

@zvonand
Copy link
Collaborator Author

zvonand commented Feb 2, 2026

S3 fails: Altinity/clickhouse-regression#93

Aggregate fails: uniqTheta was updated in upstream, not related, test will be updated separately by QA team

@zvonand zvonand merged commit 8becd9b into releases/25.8.15 Feb 2, 2026
589 of 617 checks passed
@CarlosFelipeOR
Copy link
Collaborator

QA Verification

Analysis Summary

This PR is a backport of upstream ClickHouse#87303 (with follow-ups ClickHouse#88017 and ClickHouse#88036) to the releases/25.8.15 branch.

Bug Fixed:

The move-to-PREWHERE optimization did not work when row policies were present, causing performance degradation. This fix restructures how row-level filtering interacts with PREWHERE optimization.

New Tests:

Verification Criteria:

Criteria Status
Upstream PR approved and merged
Follow-up PRs included
Backport applies cleanly
CI passing*
Tests cover the fix
Local backport fix reviewed

* Remaining Failures

Notes:

  • Large structural change (54 files) but well-tested upstream
  • Includes backport-specific fix commit.
  • Comprehensive EXPLAIN-based tests verify correct query plan generation

No manual testing required - upstream validation, follow-up fixes, and CI coverage are sufficient for this backport.
Adding verified label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants