Skip to content

Fix lost index analysis when parallel replicas estimation is enabled in a subquery - #116529

Merged
yariks5s merged 5 commits into
masterfrom
yarik/fix-pr-estimation-filter-scope
Sep 8, 2026
Merged

yariks5s merged 5 commits into
masterfrom
yarik/fix-pr-estimation-filter-scope

Conversation

@yariks5s

@yariks5s yariks5s commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

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 into CHANGELOG.md):

Fix partition pruning and primary key filtering being silently disabled when parallel_replicas_min_number_of_rows_per_replica is set inside a subquery or CTE instead of at top query level.


Workflow [PR]
Sync PR [sync-upstream/pr/116529]

Version info

  • Merged into: 26.9.1.973 (included in 26.9 and later)
  • Backported to: 26.8.3.66, 26.7.10.5, 26.6.6.6

@yariks5s
yariks5s requested a review from devcrafter August 26, 2026 14:19
@clickhouse-gh

clickhouse-gh Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [98a0c2a]

Summary: ✅


AI Review

Summary

This PR fixes the planner's filter-collection gate for parallel_replicas_min_number_of_rows_per_replica by checking nested query and UNION scopes instead of only the outer query context. That matches the reported regression for derived subqueries and ordinary CTEs with per-scope settings, and the current head plus the added regression test look consistent with that contract. I did not find an actionable correctness, safety, or metadata issue in the current diff.

Final Verdict

✅ No blocking issues found.

LLVM Coverage Report

Metric Baseline Current Δ
Lines 87.30% 87.30% +0.00%
Functions 91.90% 91.90% +0.00%
Branches 79.40% 79.40% +0.00%

Changed lines: Changed C/C++ lines covered: 11/11 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Aug 26, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 98a0c2a5b with master d33f21163 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of ab19f7494; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 711.27 MiB 708.22 MiB -3.05 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

8 translation units recompiled, 42 s compile time in total, 8 of them have a recent master baseline.

Job report

@clickhouse-gh

clickhouse-gh Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 39 queries analysed

no significant changes detected. K_source=6 K_base=29 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 2401f5b2-3b18-480b-9b64-a7bffbf0a2c4
  • MIRAI run: f07af4e4-0146-4162-953b-a62152af0032
  • PR check IDs:
    • clickbench_36642_1787857850
    • clickbench_36653_1787857851
    • clickbench_36666_1787857850
    • tpch_adapted_1_official_36678_1787857851
    • tpch_adapted_1_official_36691_1787857851
    • tpch_adapted_1_official_36761_1787857851

@clickhouse-gh clickhouse-gh Bot added the comp-query-analyzer Semantic analysis + logical/physical planning + rewrites (Analyzer and Planner modules). label Sep 4, 2026
@yariks5s
yariks5s requested a review from nickitat September 7, 2026 15:13
@yariks5s
yariks5s added this pull request to the merge queue Sep 8, 2026
Merged via the queue into master with commit 016b27c Sep 8, 2026
1116 of 1234 checks passed
@yariks5s
yariks5s deleted the yarik/fix-pr-estimation-filter-scope branch September 8, 2026 15:40
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 8, 2026
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 8, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Sep 8, 2026
clickhouse-gh Bot added a commit that referenced this pull request Sep 8, 2026
Backport #116529 to 26.8:  Fix lost index analysis when parallel replicas estimation is enabled in a subquery
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Sep 11, 2026
…llel replicas estimation is enabled in a subquery
clickhouse-gh Bot pushed a commit that referenced this pull request Sep 13, 2026
clickhouse-gh Bot added a commit that referenced this pull request Sep 13, 2026
Backport #116529 to 26.6:  Fix lost index analysis when parallel replicas estimation is enabled in a subquery
yariks5s added a commit that referenced this pull request Sep 15, 2026
Backport #116529 to 26.7:  Fix lost index analysis when parallel replicas estimation is enabled in a subquery
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Sep 18, 2026
…llel replicas estimation is enabled in a subquery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-query-analyzer Semantic analysis + logical/physical planning + rewrites (Analyzer and Planner modules). pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.4-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants