Skip to content

Skip the probe plan when a correlated subquery rules out parallel replicas - #129544

Merged
nickitat merged 14 commits into
masterfrom
autopr-remember-unmatchable
Nov 24, 2026
Merged

nickitat merged 14 commits into
masterfrom
autopr-remember-unmatchable

Conversation

@nickitat

@nickitat nickitat commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Performance Improvement

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

Automatic parallel replicas no longer builds a plan with parallel replicas for a query whose correlated subquery rules them out.


Related: #127628

To decide, automatic parallel replicas builds the plan with parallel replicas (the probe plan) and matches it against the single-node plan. When the planner then leaves parallel replicas out of the probe plan (AutoParallelReplicasPlanWithoutParallelReplicas), nothing is recorded, so every later run of the query builds the probe plan again, index analysis included, and throws it away. On TPC-H sf=1 this costs o02, o04, o17 and o22 4-14 ms per run.

The cause in those queries is a correlated subquery. DisableParallelReplicasPass turns parallel replicas off in every query and union it leaves after entering a correlated one. When that covers the whole tree, the probe plan can read nothing with parallel replicas, and that is known before anything is built.

Change

  • disablesParallelReplicasInWholeTree runs the pass's own visitor without changing the tree. It answers yes only when no query or union is left before the first correlated node is entered. A subquery in FROM that keeps parallel replicas still gets the probe built, and so does a tree with a storage other than MergeTree: such a storage may plan a query of its own when it is read (a view's body, with the view's settings), which the tree does not show.
  • buildQueryPlanForAutomaticParallelReplicas uses it to skip the build (AutoParallelReplicasSkippedDueToQuery). The check covers the query-tree implementation only; with parallel_replicas_plan_based = 1 the probe is built as before.

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

Version info

  • Merged into: 26.12.1.371-master (included in 26.12 and later)
  • Backported to: 26.11.1.2942, 26.10.13.3

When the plan built with parallel replicas could not be compared with the
single-node plan (`AutoParallelReplicasPlansNotComparable`), or the planner did
not use parallel replicas in it (`AutoParallelReplicasPlanWithoutParallelReplicas`),
automatic mode recorded neither statistics nor a verdict, so every later run of
the query built that plan again, index analysis included, and threw it away.
On short queries that cost became the result: on TPC-H sf=1 automatic mode was
5.5% slower than one node, all of it from ten such queries (+4-28 ms per run).

Remember the outcome under the same key as the remembered boundary (the
single-node plan's root hash and the parallel-replicas settings), for ten
minutes, so that plans which start to match as the data changes are noticed.
Later runs skip building the plan and count the same outcome event, plus
`AutomaticParallelReplicasDecidedWithoutBuildingPlan`. Only the outcomes that
depend on the two plans alone are remembered; `automatic_parallel_replicas_remember_boundary = 0`
turns it off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [12e4df3]

Summary: ✅


AI Review

Summary

PR #129544 skips the automatic parallel-replica probe when the existing analyzer pass would disable replicas throughout the query tree. The check preserves probing for opaque storages and queries visited before correlation is found, and excludes plan-based replicas. No actionable findings remain in the current diff; the earlier findings are addressed. The focused 05508_autopr_skip_correlated_subquery regression passed in Fast test at the current PR head, verifying eliminated probes and preserved probe cases.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-performance Pull request with some performance improvements label Nov 5, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). label Nov 5, 2026
…sion

When `max_execution_time_leaf` is stricter than `max_execution_time`, the
local replica cannot honour it, so the plan with parallel replicas is built
without the local branch and cannot be compared with the single-node plan.
Neither timeout is in `parallelReplicasBoundarySettingsHash`, so that verdict
was remembered under the same key as the query without the leaf timeout, and
that query skipped automatic parallel replicas for ten minutes. Hash the
outcome of `leafTimeoutRequiresRemoteOnlyLeafReading` rather than the timeouts,
so only the sessions it applies to get a key of their own.

Also initialise `UnmatchedEntry::reason`, which failed the `clang-tidy` build:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129544&sha=latest&name_0=PR
#129544

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 12e4df3bd with master d5206181a (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

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

Job report

nickitat and others added 2 commits November 5, 2026 21:21
…ca caused

`prepareConnectionPoolsForParallelReplicas` drops inactive replicas. With only
the initiator left, the plan with parallel replicas falls back to the local
plan, and automatic parallel replicas remembered that as
`PlanWithoutParallelReplicas` for ten minutes. Bringing the replicas back
changes nothing in the key, so the query kept skipping the optimization.

The probe mark on `Context` is now a state object shared by every context of
the plan with parallel replicas. `executeQueryWithParallelReplicas` and
`createParallelReplicasPlan` set it when they fall back for a reason that can
pass while the query stays the same (one usable replica, nothing to read), and
then no verdict from that build is remembered.

A cluster that has only one node is now turned down before the plan is built,
by asking `ClusterProxy::canUseParallelReplicasOnInitiator`, which counts the
nodes, rather than the context's check, which does not. Before, it built the
plan, found no parallel replicas in it, and remembered that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…verdicts

Remembering why the plan with parallel replicas could not be used is only
right when the reason is a function of the key it is remembered under, and it
is not: the probe's join order comes from row estimates and from the hash
table sizes earlier runs measured (`getCachedHint`), so a plan that is not
comparable on the first run can match on the second; replica liveness, the
leaf timeout and an empty table are outside the key as well. Remove the cache
of unmatched plans and everything added to key it.

Instead, decide up front, from the query tree, the case that is known to end
without parallel replicas: `DisableParallelReplicasPass` turns them off when
the query has a correlated subquery, and when it does so in every query and
union, the planner reads nothing with them. `disablesParallelReplicasInWholeTree`
answers that with the pass's own visitor, without changing the tree, and the
builder then skips the build as a `QueryShape` skip. Plan-based parallel
replicas choose the read in the plan, so they are left to the build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nickitat nickitat changed the title Remember a plan with parallel replicas that automatic mode could not use Skip the probe plan when a correlated subquery or a single-node cluster rules out parallel replicas Nov 6, 2026
Resolving the cluster before the query-shape checks made a local `FULL JOIN`
throw `UNEXPECTED_CLUSTER` in automatic mode with a two-shard
`cluster_for_parallel_replicas`. Keep only the correlated-subquery skip.

#129544

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nickitat nickitat changed the title Skip the probe plan when a correlated subquery or a single-node cluster rules out parallel replicas Skip the probe plan when a correlated subquery rules out parallel replicas Nov 6, 2026
A view plans its body when it is read, with its own settings: an aggregating
`SQL SECURITY INVOKER` view with `SETTINGS enable_parallel_replicas = 1`
reads with parallel replicas even under a correlated predicate in the outer
query, so skipping the probe there lost a plan that matched. Only `MergeTree`
tables are read with the context of the query around them; any other storage
now counts as unknown, and the probe is built as before.

#129544

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nickitat nickitat added the ci-force-all Do not skip any jobs when running label Nov 17, 2026
nickitat added a commit that referenced this pull request Nov 17, 2026
…othing

`LIMIT` without `ORDER BY` makes the plans incomparable only because of a bug that is to be fixed, and a correlated
subquery is to be ruled out before building the plan with parallel replicas
(#129544). Either change would have broken the cases built on them. An
inner join with an empty build side, whose collection measures nothing, is deferred by design, so the turn-taking,
the disabled setting and the largest value are checked with it instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…_plan_based`

The cost model works off estimated compressed bytes, and adaptive codec selection,
now randomized in stateless tests, changes them, so the second run stops adopting
parallel replicas. The sibling `05262` was already pinned the same way.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129544&sha=10b2b5fe60611b692e06c8babb025f3cc4dbebca&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
PR: #129544

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A storage other than `MergeTree` is opaque to the query tree; nothing says it
plans a query of its own, so stop claiming it. Rename `reads_storage_with_own_query`
to `reads_opaque_storage` to match. Explain why only the queries left before
the first correlated node keep parallel replicas: `is_correlated` is never reset,
so everything left after it, the root included, loses them, which is what makes
`disablesEverywhere` mean every query and union.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nickitat nickitat removed the ci-force-all Do not skip any jobs when running label Nov 19, 2026
@nickitat
nickitat marked this pull request as ready for review November 19, 2026 20:52
@nickitat
nickitat requested a review from novikd November 19, 2026 20:52
leshikus pushed a commit to leshikus/ClickHouse that referenced this pull request Nov 19, 2026
…_plan_based`

The cost model works off estimated compressed bytes, and adaptive codec selection,
now randomized in stateless tests, changes them, so the second run stops adopting
parallel replicas. The sibling `05262` was already pinned the same way.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129544&sha=10b2b5fe60611b692e06c8babb025f3cc4dbebca&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
PR: ClickHouse#129544

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 52da073)
AbinMadathil07 added a commit to AbinMadathil07/ClickHouse that referenced this pull request Nov 20, 2026
* Keep the dictionary and bloom filter cases of five more Parquet tests live

These tests compare values only, so they kept passing when a random
setting removed the encoding or the index their case is about:

- 05406: a random `output_format_parquet_max_dictionary_size` of 0, 1
  or 1024 writes the dictionary round trip without a dictionary, and
  `output_format_parquet_use_alp_encoding = 1` writes float columns
  without one at any size, so the case that the dictionary keeps zero,
  negative zero and NaNs with different payloads apart tested nothing.
  Bound the dictionary size to at least 1 MiB and pin ALP off.
- 04646: the two cases of the exact dictionary filter need a
  dictionary page and the dictionary pruning pass, which a high
  watermark of 1 byte or 1 MiB skips. Bound both, as in 05055.
- 02735: 1M distinct values must grow the dictionary past its 1 MiB
  limit. With 0 no dictionary is tried, and with 1 or 1024 the writer
  drops it within the first two batches, so bound it to at least 1 MiB.
- 04097: the bloom filter prefetch regression needs a bloom filter
  written with the default bits per value and read with push-down.
- 04545: it also covers the page index path, which needs a page index.

The other Parquet tests either set these settings on their writes and
reads, assert the encodings, the bloom filters or the pruning, or do
not depend on them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: release only own bucket locks, detect empty batches independently of commit limits

With `parallel_inserts` each streaming task has its own processor and commits independently,
but `FileIterator::releaseFinishedBuckets` released the finished bucket holders of all processors.
A holder is finished when its source reaches the end, before the insert of that source completes,
so a commit of one task could release the bucket lock of another task whose insert was still running,
letting another replica take the bucket and process later files before the first insert failed.
Now `releaseFinishedBuckets` takes the processors of the batch which has just been committed.

`ProcessingProgress::processed_files` is counted only when `max_processed_files_before_commit` is set,
so with that limit disabled and a row or byte limit enabled, a batch which processed files looked empty:
the consumption cycle ended after every batch and the backlog was drained one batch per poll.
Now a separate `acquired_files` counter, maintained regardless of the commit limits, is used to detect
empty batches, to guard the reset of the batch size override, and as the size of a failed batch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Document the musl Rust target in the build guide

The default Linux x86_64 and aarch64 build links against musl now, and
`contrib/corrosion-cmake` selects the matching `*-unknown-linux-musl`
Rust target. `rustup` installs only the `*-unknown-linux-gnu` target, so
following the guide made `cmake` fail with
`Target x86_64-unknown-linux-musl is not installed for toolchain`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* GPU aggregation: remove `GPUAggregatingStep`, one `canAggregateOnDevice`, fixes of the AI review

- No `GPUAggregatingStep` in `src/Processors/QueryPlan` in this pull request.
- `canAggregateOnDevice` replaces `canReduceOnDevice`, `canGroupByOnDevice`, `canGroupByReduceOnDevice` and their `OrThrow` variants.
- `streaming_groupby` is closed into parts before a group could count past a `cudf::size_type`.
- No `avg` of `Float32`, which cuDF sums in `Float32`; no `min` or `max` of floats, as cuDF does not skip a `NaN` like ClickHouse.
- Exceptions of cuDF, rmm and libstdc++ are never destroyed (`keepCurrentException`): their base destructors bind to those of libc++.
- `ColumnUploadPipe::takeDeviceColumn` makes the next buffer in place, as the buffers have no assignment.

Related: ClickHouse#132443

* GPU aggregation: no gtest in this pull request

Related: ClickHouse#132443

* Bump `musl` to fix `AI_ADDRCONFIG` lookups on loopback-only hosts

Fork commits `f255b5c8` and `ff1ab367` gave `getaddrinfo` glibc's
`AI_ADDRCONFIG` semantics. On a host with no non-loopback address, they
dropped both address families and returned `EAI_NODATA` for every name.
`DNSResolver` always passes `AI_ADDRCONFIG`, so `clickhouse-client`
could not resolve `localhost` under `docker run --network none`,
`unshare -n` or systemd `PrivateNetwork=yes`. As in glibc, an
`AF_UNSPEC` lookup is now not narrowed when neither family is
configured.

The bump also brings in ClickHouse/musl#20 (symbol sizes for asm
functions).

ClickHouse/musl#21

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix the `contrib/llvm-project` pin to the real tip of `ClickHouse/release-23.x`

The merge of master pinned `55541575edec5a8d4bb94faf4a66e30d8b4e7a66`, which
does not exist: only the 12-character prefix matches the real merge commit of
ClickHouse/llvm-project#161. `Config Workflow` failed
to fetch it:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=132795&sha=b50187317c6de5b87b22060d147f749bc4b35535&name_0=PR&name_1=Config%20Workflow

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: list adbcBridge under Go, Rust, Java and C# in the third-party client libraries

* GPU aggregation: far fewer comments, one `catch` in `guarded`, no slices in `streaming_groupby`

- `guarded` catches once and keeps the exception of the device libraries from being destroyed in one line; the messages are read by `messageOfDeviceException`.
- `StreamingPartials` takes a batch as it is, and closes before `streaming_groupby` could count past a `cudf::size_type`.

Related: ClickHouse#132443

* Look up the `geoDistance` tables once per block

`distance` is called for every row, and since the tables are built on first use, every access to them went through the initialization guard of the local static in `impl`. `run` now takes the reference once and passes it to `distance`.

Address review: ClickHouse#126791 (comment) (thread on `src/Functions/greatCircleDistance.cpp`)

Co-Authored-By: Claude <[email protected]>

* Docs: describe the Protobuf framing ClickPipes expects with AWS Glue

* Use `VectorWithMemoryTracking` for the lazy Arrow type table

The style check that came with the merge of `master` forbids plain `std::vector` in `src/Processors/Formats`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=46136c021aceb2c4ed4368a0a1a9f3ba214be6a8&name_0=PR&name_1=Style%20check
PR: ClickHouse#126791

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Mark the `geoDistance` table lookups `[[nodiscard]]`

`clang-tidy` asks for it (`modernize-use-nodiscard`) since they became `const` members.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=384918398089744c9929f936ac283fbf88622246&name_0=PR&name_1=Build%20%28arm_tidy%2C%202%2F4%29
PR: ClickHouse#126791

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Let gdb pass the `system.stack_trace` signal of the musl server in fuzzer jobs

The gdb script took the number of `SIGRTMIN` from the shell of the fuzzer
image, which is linked with glibc: 34. The server is a static musl binary since
ClickHouse#109239, and its `SIGRTMIN` is 35,
so gdb stopped the server on the first read of `system.stack_trace`, dumped
all threads and detached. Handle both numbers.

Co-Authored-By: Claude <[email protected]>

* Pin 05829 to query-based parallel replicas

`Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel)`
sets `parallel_replicas_plan_based = 1` in the server profile. The test pins every
other parallel-replicas setting, so in that job only its implementation changes:
plan-based parallel replicas cannot match the shipped plan to the single-node plan
(`Cannot find step with matching hash ... in single-node plan`; the local plan has
one `Expression` under `Aggregating` where the single-node plan has two), so the
first run collects no statistics and the second never switches to the plan with
parallel replicas: `05829_apply 0` in every master run of the job.

Pin query-based parallel replicas, as 91d6019 did for 05175 (same class,
ClickHouse#131450), so the test keeps
checking the set transplant of ClickHouse#132659 in that job too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update PGO+BOLT toolchain to 51fdb0b

* Adapt new code from `master` to the removed `CPUFlagsCache` and the `STACK_TRACE_SERVICE_SIGNAL` macro

`gtest_memchr_strlen_page_boundary.cpp` used `CPUFlagsCache`, which this branch removed; it calls the `have*` functions instead, which is all `CPUFlagsCache` did (once, in a static initializer).

`clickhouse_fuzzer.cpp` qualified `STACK_TRACE_SERVICE_SIGNAL` with `DB::`, which does not work now that it is a macro.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=876eaabafb0dc84ddaae5134998fb9d140634297&name_0=PR&name_1=Build%20%28amd_debug%29
PR: ClickHouse#126791

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Run the EXPLAIN checks of 05137_join_fixed_string_zero_bytes_runtime_filter without parallel replicas

Under plan-based parallel replicas, ReadFromParallelReplicasStep sets its
step description to a multi-line dump of the shipped plan fragment
(header and description, no actions), truncated at
query_plan_max_step_description_length = 500, and EXPLAIN prints every
line of it as a row. The fragment contains the build side's
BuildRuntimeFilter step. With enable_parallel_blocks_marshalling = 1 the
fragment's top BlocksMarshalling step pushes that line past the cut; with
0, which the runner draws in about 5% of runs, it fits, and the test's
LIKE filter matches one row more than the reference.

The EXPLAIN checks assert the single-node plan shape, so run only them
with enable_parallel_replicas = 0 in their own SETTINGS, as ClickHouse#128527 does.
The result queries keep whatever the job sets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin the Top-K limit in 05100_autopr_gate_lazy_read

`clickhouse-test` randomizes `query_plan_max_limit_for_top_k_optimization`
over [0, 1, 10, 100, 1000, 100000]. At 0 (no limit) or 100000, Top-K takes
the test's `ORDER BY ord LIMIT 10000` and adds `__topKFilter(ord)` to the
read's PREWHERE. Plan-based parallel replicas keeps such a read local
(`mergeTreeReadCanBeShipped`), so automatic parallel replicas finds no read
on the other replicas, skips the query and collects no statistics, and the
`05100_lazy_large_scan` row turns from 1 to 0 in
`Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel)`.

Pin the limit to its default, as 801dfec did for 05055. The product
limitation is ClickHouse#131858.

Locally, with `parallel_replicas_plan_based=1` and the limit at 0 or 100000:
5/5 FAIL before, 5/5 OK after, 5/5 FAIL again with only the new `SET`
removed. Fully randomized plan-based runs: 6/50 FAIL before, 50/50 OK after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin 05628 and 05043 to query-based parallel replicas

Both tests failed in `Stateless tests (arm_binary, ParallelReplicas, plan-based,
s3 storage, parallel)`, the job ClickHouse#128413 added, whenever the randomizer drew
`query_plan_merge_filters = 0` (05628) or `query_plan_remove_unused_columns = 0`
(05043), each about 5% of runs. With `parallel_replicas_plan_based = 1`,
automatic parallel replicas then cannot match the probe plan to the single-node
plan (`Cannot find step with matching hash ... in single-node plan`,
`AutoParallelReplicasPlansNotComparable = 1`) and returns before the cost model
and before collecting statistics, so 05628's "declined after the cost model"
check and 05043's "still a candidate" check read 0. That is the open
plan-based gap ClickHouse#131450.

The tests are about query-based automatic parallel replicas, so pin that
implementation, the same way 91d6019 pinned 05175 for ClickHouse#131450. The pin is
a no-op in every job where plan-based parallel replicas is already off.

Related: ClickHouse#131450

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Retry a failed notary submission request and wait longer in Sign macOS binary

`notarize` ran `rcodesign notary-submit --wait --max-wait-seconds 1800` once.
rcodesign does not retry the create-submission POST, so one Apple gateway 502
on it failed the job, and its wait gave up at 1800 s although the job has a
3600 s timeout and the other steps take at most 39 s. Both leave the release
commit without a signed `clickhouse-macos.zip` until the job is re-run by hand.

Retry the command up to 5 times, but only when stderr carries the
`POST https://appstoreconnect.apple.com/notary/v2/submissions` line. rcodesign
prints it only in the error of a failed create-submission request (the request
log line is debug-level), i.e. before the upload and before any wait, so a retry
costs about 30 s at most and never starts a second wait. A failed poll, a failed
upload, the wait limit and an Invalid verdict print no such line and stay
single-attempt. Matching on the 5xx text instead would also catch a 5xx on a
poll late in the wait and resubmit, which does not fit the job timeout.

Raise the wait limit to 3000 s: 39 s of earlier steps + 30 s of retries + 3000 s
+ upload and one poll is about 3115 s, under the 3600 s timeout, so the
`finally` that removes the notary key from the reused workspace still runs.

Failures:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=8f7ca0110849149ecd80a33dc2691ad0e0bb36c1&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=c2ea85cb077899bcc31505a53bb11b9dc34e803d&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=53e154ba93c524095e4cfb9957fa35e206086684&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: sync Cloud API reference from the OpenAPI spec

* Docs: regenerate reference documentation from source

* Fix the number of read streams in test `05830_distributed_plan_squashing_before_exchange`

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Return NULL from `conv` for a non-finite float masked by NULL

`FunctionConv` inherited `canBeExecutedOnDefaultArguments = true`, so the default implementation for
`Nullable` arguments passed the nested values of NULL rows to `executeImpl`. Since a non-finite float now
throws, `conv(nullIf(x, inf), 10, 10)` and `conv(if(isNaN(x), NULL, x), 10, 10)` failed with
`BAD_ARGUMENTS` instead of returning NULL for those rows, as did a non-finite number on a row with a NULL
base. Rows with a NULL argument are now skipped before execution. Non-NULL `nan` and `inf` still throw.

The override is byte-identical to the one ClickHouse#122356 added on master, so the two merge cleanly.

PR: ClickHouse#132662

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix the HTTP interface link in the `Protobuf` format documentation

ClickHouse#122644 moved the HTTP interface page from `/concepts/features/interfaces/http`
to `/concepts/features/connect-to-clickhouse/protocols/http` and updated the
`#insert-protobuf` link in the generated `docs/reference/formats/Protobuf/Protobuf.mdx`,
but not in its source, the `Protobuf` format documentation here. The nightly
docs regeneration (ClickHouse#132899) therefore restores the old path, and the offline
link check (`lychee_check.py --mode links`) cannot resolve the fragment through
the redirect, because the redirect's destination is a directory `index.mdx`:

    [./reference/formats/Protobuf/Protobuf.mdx]:
    [ERROR] concepts/features/interfaces/http#insert-protobuf (at 347:27) | Cannot find fragment

Make the same change in the source, as ClickHouse#122644 did for the Prometheus links in
`StorageTimeSeries.cpp`. The regenerated `Protobuf.mdx` is then identical to the
one on master. Validated by regenerating the docs with `autogenerate_docs.py
--write` from a master binary with and without the change and running the
link check: 1 error (the one above) without, 0 with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* GPU aggregation: the `avg` of unsigned integers divides a `UInt64` sum; `absorbPart` keeps the originals until the copies are done on an exception too

Related: ClickHouse#132443

* GPU aggregation: `CudfGroupBy.cu` rewritten to be readable

The same algorithm: `Partials`, `PartitionedPartials`, `StreamingPartials`, `GroupBy` with a `Strategy` chosen by the first
batch, the filter in `applyFilter`. No checks that `viewOf` and the lane already make, no branch for keys with nulls of an
undecided batch, which are compacted.

Related: ClickHouse#132443

* GPU aggregation: `waitFor` in `GPUTypes.cuh`, next to `checkCuda`, as it is not of `CudfGroupBy`

Related: ClickHouse#132443

* GPU aggregation: every entry point of `CudfGroupBy` and `CudfReduction` is `guarded`

What rmm, cuDF and libstdc++ throw outside of the calls to cuDF, as the growth of a buffer or a copy of a column, does not leave
the island either: an exception of libstdc++ is not safe to format by ClickHouse.

Related: ClickHouse#132443

* GPU aggregation: `CudfGroupBy` is a class, not an interface of one implementation; masks are `DeviceBitmask`

- `CudfGroupBy` holds a `cudf_group_by::GroupBy` as `CudfReduction` holds its state, and its methods are `guarded` calls of it;
  no `createCudfGroupBy`, no `dynamic_cast` in `absorbPart`.
- The masks of the rows a filter keeps are a `DeviceBitmask` of their words and rows, not a pointer.

Related: ClickHouse#132443

* Inline the liveness check of window aggregate states

`checkCreated` was not inlined, so every row paid for a call with a full frame. Inline the test and keep only the throw out of line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: update Cloud API rate limits and describe 429 responses

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* GPU aggregation: the stream of a `HAVING` is drained on an exception too, as the caller holds its kernel only for the call

Related: ClickHouse#132443

* Remove the files left behind by `02366_cancel_write_into_file`

The test inserts into 20 files in `user_files` and kills the inserts, but
never removes the files. The targeted check of this PR repeats the test 33
times with a new database each time: its killed inserts wrote 58 GiB of files
that stayed on disk, and the runner ran out of space (`errno: 28`), failing
unrelated tests.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=131078&sha=latest&name_0=PR
ClickHouse#131078

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Randomise adaptive compression in stateless/stress tests

* AI review: require an exact verdict line and parse it leniently

The review prompt now asks for an exact `Status: <verdict>` line. `_review_approves` falls back to the whole `Final Verdict` section when that line is missing, so a bare `✅ Approve` no longer dismisses the approval.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin two UNIQUE KEY tests to query-based parallel replicas

With `parallel_replicas_plan_based = 1`, a read of a `UNIQUE KEY` table is
shipped and `ReadFromMergeTree::serialize` throws `SUPPORT_IS_DISABLED`
(ClickHouse#128534). `04161_unique_key_insert_duplicate` and
`05493_unique_key_disk_without_append` read such a table only through
`count()`, so in the plan-based job they fail only when the runner draws
`optimize_trivial_count_query = 0` (5% of runs) and pass otherwise.

The plan-based blacklist is checked strictly (the job does not run with
`--autopr`), so listing them would report `NOT_FAILED` on most runs, as it
did for 04161 on ClickHouse#128413. Pin them to query-based parallel replicas
instead, the way 91d6019 did for 05175. ClickHouse#128534 stays open for
plan-based support of `UNIQUE KEY` reads.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=6ade2c8d6b94ea04a0c7b0259825529aceac0fd8&name_0=MasterCI&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20plan-based%2C%20s3%20storage%2C%20parallel%29

Related: ClickHouse#128534

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Drop unneeded no-parallel tags from seven stateless tests

* Update version_date.tsv and changelogs after v26.10.7.24-stable

* Disable Keeper fault injection in `05770_streaming_queries_replicated_cursors`

An injected Keeper fault after a block number is allocated makes the insert
retry with a new block number, so the block numbers and the cursors in the
test become nondeterministic.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=131817&sha=latest&name_0=PR&name_1=Fast%20test
ClickHouse#131817

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Disable adaptive codecs where they're not needed

* Docs: restore `Language clients` navigation

Remove the duplicate `integrations/language-clients/index` entry from the Concepts navigation. Mintlify then selects the dedicated `Language clients` navigation for the page.

Related: ClickHouse#124471

* Pack tuples of fixed-size values into the keys of the radix partitioned `uniqExact`

A tuple whose elements have a fixed size of 1, 2, 4, 8 or 16 bytes and fit into 16 bytes, `Nullable` ones
included, is packed into one key as `packFixedBatch` packs the keys of `GROUP BY`, instead of being hashed
with `SipHash` per row. A `Nullable` element is its null flag, normalized to 0 or 1, and its value, zero for
NULL. Values of 16 bytes are routed by `routeValues`, without branches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hash the other values of the radix partitioned `uniqExact` several rows at a time

The values that are hashed with `updateHashWithValue` (tuples of strings, `Nullable` and wider values) get
the same `hash128` from `HashedJoinKey`, which hashes many rows at once with the vectorized `SipHash`. The
rows that repeat the previous one are skipped before they are hashed (`HashedJoinKey::markRepeatedRows`),
and the types it cannot hash in batches keep the per-row path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update version_date.tsv and changelogs after v26.8.41.14-lts

* Keep each `-iquote` paired with its directory when building musl

CMake de-duplicates compile options, so only the first "-iquote" was kept
and the other two directories became stray input files. Use `SHELL:` to
keep each flag and path together.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Add PromQL tests flaky with plan-based parallel replicas to the plan-based blacklist

A plan-based parallel replica cannot find the tags collected by
`timeSeriesStoreTags`, so `timeSeriesIdToGroup` throws `Unknown identifier`
when a remote replica reads part of the table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Push `empty` and `notEmpty` of a `String` column down into the Vortex scan

`optimize_empty_string_comparisons` rewrites `s = ''` and `s != ''` into
`empty(s)` and `notEmpty(s)` before the filter reaches `ReadFromFile`, and
`VortexExpressionConverter` had no handler for them, so the conjunct was dropped:
the scan decoded and converted every row of the column, and only ClickHouse
filtered it. Now they become `s = ''` and `s != ''` in the scan, which is exact in
any position; arrays, maps and UUIDs stay with ClickHouse.

ClickBench on one `hits.vortex`, 36 cores, hot run: Q10 228 -> 123 ms,
Q12 331 -> 242 ms, Q24 368 -> 212 ms, Q31 499 -> 393 ms.

https://benchmark.clickhouse.com/#system=-&type=-&machine=-ca4e|6t|ae-|ca2|6ax|cgle|6ale|3al&cluster_size=-&opensource=-&hardware=+c&tuned=+n&storage=+vr&category=-&metric=combined&best=no&queries=-

* Sync `src/Core/ServerSettings.cpp` from private repository

* Do not pack the `LowCardinality` elements of a tuple in the radix partitioned `uniqExact`

A `LowCardinality` type forwards the size of its values, but its column holds indexes into a dictionary,
so packing it read the indexes as values and counted wrong. Such tuples are hashed. The test also covers
runs of equal rows longer than a batch of hashing, with NULLs and floats.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Allocate the buffers for the rows to skip exactly

`resize_fill` rounds the allocation up to a power of two, which doubles a buffer of 65536 rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Add tuples to the performance test of the radix partitioned `uniqExact`

Packed fixed-size tuples, `Nullable` or not, and tuples hashed several rows at a time, with strings or wider
than 16 bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix `HTTPResponseParser.MatchesPocoForEverySplit` for `MalformedMessageException`

The test compared the class of the exception with the one of the legacy
`HTTPResponse::read`, which throws `MessageException` where the parser now
throws its subclass `MalformedMessageException`. Compare them as the same
class, and check the distinction between a malformed and a truncated response
in a new test `MalformedIsNotTruncated`.

Also update the comments after the merge of master, where a header that exceeds
a limit throws `HTTPHeaderLimitException` and is reported as `LIMIT_EXCEEDED`.

Address review: ClickHouse#132117 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update version_date.tsv and changelogs after v26.9.33.10-stable

* Address review: skip all fresh-`CREATE` validations of `DataLakeCatalog` when replaying stored metadata

The `auth_header` check, the `allow_database_*` gates, and the strict
settings parsing in `loadFromQuery` ran before the recovery predicate, so a
previously valid definition replayed as `CREATE` with
`isRecoveryFromStoredMetadata` could still throw and block startup. Compute
the predicate first and treat such a replay like `ATTACH` everywhere.
A forbidden header is still never sent: `RestCatalog::validateAuthHeaders`
rejects it before the first request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Add a test for obsolete access types and their group membership

`REVOKE SYSTEM` and `REVOKE ALL` must also remove a grant of the obsolete
`SYSTEM RELOAD MODEL` privilege.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin blocks marshalling for the EXPLAIN checks of 05137, blacklist it for plan-based

The checks pass with query-based parallel replicas, so keep parallel replicas on.

ClickHouse#132869 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: update clickhousectl pages for clickhousectl 0.6.0

Use the new `cloud clickhouse` and `local clickhouse` command names, fix
statements that changed in 0.6.0 (project-root discovery, Query API keys,
Postgres no longer Beta, organization errors, exit codes) and cover the
new commands and flags.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: reject repeated grouping-set keys and the memory-bound grouping-sets merge

A deserialized `MergingAggregated` step with grouping sets now refuses an input in which a key occurs more
than once (the output header and `makeCreatingMissingKeysForGroupingSetDAG` take keys by name), and the
memory-bound merge with grouping sets, which threw a `LOGICAL_ERROR` in `transformPipeline`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Revert "Detect MemorySanitizer and UndefinedBehaviorSanitizer reports in integration tests"

* Fix nightly changelog job hanging in `changelog.py`'s `git fetch --tags`

The `Prepare changelog` job of the `Nightly` workflow has failed every night
since 2026-11-03, so ClickHouse#126190
stopped receiving updates after 2026-11-02. The generation step is killed by
`GENERATE_TIMEOUT_SEC` (40 minutes) while `changelog.py` sits in
`Fetching all tags`.

That fetch runs in the `clickhouse/style-test` container. `actions/checkout`
keeps the credentials in a separate file included via
`includeIf.gitdir:<host path>/.git`, which does not match `/wd/.git` in the
container, so the fetch is unauthenticated and uses the default refspec. It
was already 16 minutes on 2026-11-02 and is redundant: `prepare_repo` has
fetched the master history and the tags just before.

Add `--no-fetch` to `changelog.py` (it refuses a shallow repository instead of
fetching) and use it in the nightly job.

https://github.com/ClickHouse/ClickHouse/actions/runs/44444590723
https://github.com/ClickHouse/ClickHouse/actions/runs/41566219634

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin `enable_adaptive_codec_selection = 0` in `05293_autopr_statistics_plan_based`

The cost model works off estimated compressed bytes, and adaptive codec selection,
now randomized in stateless tests, changes them, so the second run stops adopting
parallel replicas. The sibling `05262` was already pinned the same way.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129544&sha=10b2b5fe60611b692e06c8babb025f3cc4dbebca&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
PR: ClickHouse#129544

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 52da073)

* Up-sync critical files from ClickHouse-private master 5dfd845349c2b0a11b24b335ea1a0ac0006b6eed

* Docs: regenerate `Protobuf` HTTP interface link

Regenerate the `Protobuf` format page after the source documentation update in ClickHouse#132918.

ClickHouse#132899

* Pin `parallel_replicas_plan_based = 0` for the reads without the privilege in `02346`

ClickHouse#133090
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=115581&sha=2b81f2df5a513b9465dd994ca03e16aea6db2158&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20plan-based%2C%20s3%20storage%2C%20parallel%29
ClickHouse#115581

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin the dictionary size in 05829_parquet_array_over_many_pages

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Up-sync critical files from ClickHouse-private master d5e43de9252801cefdbd7fbc02460438c2815b66

* Update autogenerated version to 26.12.1.1 and contributors

* Sync MergeTreeSettings.h from private: declare isSystemDatabaseForDisks

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Document the PARTITION BY clause of INSERT INTO FUNCTION

The parser accepts an optional `PARTITION BY expr` after the table function of
`INSERT INTO [TABLE] FUNCTION`, before the column list, and the file and object
storage table functions use it for partitioned writes, but the `INSERT INTO`
reference page never mentioned it.

Add the clause to the syntax of the "Inserting using a Table Function" and
`RETURNING` sections and to the structured syntax, and add a short
"Partitioned writes" subsection with a runnable `file()` example that links to
the per-function partitioned-write sections.

The page docs/reference/statements/insert-into.mdx is generated from
ParserInsertQuery::getDocumentation() by the nightly docs regeneration, so only
the source registration changes here.

Closes: ClickHouse#132930

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Mark `JoinStep::clone` `[[nodiscard]]` to satisfy `clang-tidy`

The `arm_tidy` build failed with `modernize-use-nodiscard`:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130374&sha=317ff1c910b87d28e30b261588ee6636cceb871a&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29
PR: ClickHouse#130374

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin the randomized Parquet settings in 05833_parquet_prewhere_edge_cases

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin the randomized Parquet settings in 05835_parquet_nullable_tuple_read_memory

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Make test_status_counts fail with the reload's own error

`metrics_during_load` ran `SYSTEM RELOAD DICTIONARY d_slow` in a
`threading.Thread` and only joined it. A thread's exception reaches only
`threading.excepthook`, so a failed reload before the poll saw the
in-progress status was retried as a timing miss (ending in the misleading
"the metrics were never computed while d_slow was LOADING"), and in the
LOADED_AND_RELOADING check a failed reload kept the dictionary LOADED, so
its sample was accepted and the test passed with only a thread warning.

Run the reload through `ThreadPoolExecutor.submit` and call
`future.result()` on both exits of the helper, the early return and after
the sample, so a failed reload raises its own error before a sample is
retried or accepted. `result()` waits like `join()`, and the executor's
`shutdown(wait=True)` still waits for the reload when the main thread
raises. Retries, assertions and the `d_fail` part are unchanged.

Follow-up to ClickHouse#132816, as suggested in
ClickHouse#132816 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Parse JSON documents in place in JSON functions instead of copying each row

* Use a per-database user name in `05836_obsolete_access_type_grants`

The test used a fixed user name, so concurrent runs in the flaky check
created, granted to, and dropped the same user, failing with `UNKNOWN_ROLE`.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123854&sha=6f09c63c7c931c9e0e02bedc03c8675a14f27dee&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29
ClickHouse#123854

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* WIP: support Array(Int8) and Array(UInt8) in the Quantized codec

Temporary commit, not built or tested yet.

- `ColumnsDescription`: accept `Int8`/`UInt8` elements, reject methods
  `int8` and `prefix` with format `int8` for them.
- `SerializationQuantizedVector`: read `Int8`/`UInt8` vectors; for
  `rabitq`/`turboquant`, `UInt8` elements are shifted by -128.
- Planner: accept integer reference literals and shift the reference
  vector the same way for `UInt8` columns.
- Docs updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use the `rabitq`/`turboquant` codes for `L2Distance`, add tests for byte vectors

`rabitq` and `turboquant` estimate only the cosine distance. For an
`L2Distance` query, the shortlist is now ranked by the cosine estimate and
the result is rescored by the exact `L2Distance`, instead of falling back to
the exact scan. The returned distances are exact; the recall depends on how
much the vector norms vary.

Measured on 300k vectors of Dino10B (1024-d, `UInt8`, L2), 300 queries,
recall@10 against exact L2 at fetch multiplier 1/5/10/50:
`rabitq` 0.69/0.98/0.99/1.00, `turboquant` 0.74/0.99/1.00/1.00
(with the `UInt8` shift; without it `rabitq` gets 0.11/0.27/0.35/0.59).

Also fix a `-Wdouble-promotion` error in the `UInt8` shift of the reference
vector, and add test `02354_vector_search_quantize_codec_int8_uint8`.

Dataset: https://swannbessa.github.io/blog/dino10b/

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Shorten the comment on `QUANTIZED_CODEC_UINT8_SHIFT`

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix `clang-tidy` in `gtest_join_step_clone`: do not ignore the `[[nodiscard]]` result of `clone`

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130374&sha=8388bd749944f4f99fc8324968cb38dc32f2a462&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29
ClickHouse#130374

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: regenerate reference documentation from source

* docs: sync upstream clickhouse-operator docs updates (v1alpha2 deprecations)

---------

Co-authored-by: Nikita Fomichev <[email protected]>
Co-authored-by: Groene AI <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Alexey Milovidov <[email protected]>
Co-authored-by: Nikolai Kochetov <[email protected]>
Co-authored-by: Konstantin Bogdanov <[email protected]>
Co-authored-by: Konstantin Vedernikov <[email protected]>
Co-authored-by: singhpratech <[email protected]>
Co-authored-by: Julia Kartseva <[email protected]>
Co-authored-by: Mark Dawson <[email protected]>
Co-authored-by: Konstantin Bogdanov <[email protected]>
Co-authored-by: Nihal Z. Miaji <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: robot-clickhouse <[email protected]>
Co-authored-by: Pedro Ferreira <[email protected]>
Co-authored-by: Alexander Gololobov <[email protected]>
Co-authored-by: Nikolai Ovchinnikov <[email protected]>
Co-authored-by: Matheus Nerone <[email protected]>
Co-authored-by: Igor Nikonov <[email protected]>
Co-authored-by: Raúl Marín <[email protected]>
Co-authored-by: Shaun Struwig <[email protected]>
Co-authored-by: Raúl Marín <[email protected]>
Co-authored-by: Murphy <[email protected]>
Co-authored-by: Alex Kalmakov <[email protected]>
Co-authored-by: Nikita Taranov <[email protected]>
Co-authored-by: rienath <[email protected]>
Co-authored-by: Kirill Kopienko <[email protected]>
Co-authored-by: Nikita Taranov <[email protected]>
Co-authored-by: Konstantin Vedernikov <[email protected]>
Co-authored-by: Antonio Andelic <[email protected]>
Co-authored-by: Yaroslav Briukhovetskyi <[email protected]>
Co-authored-by: Azat Khuzhin <[email protected]>
Co-authored-by: Pavel Kruglov <[email protected]>
Co-authored-by: Maksim Dergousov <[email protected]>
Co-authored-by: Nikolay Degterinsky <[email protected]>
Co-authored-by: Anton Popov <[email protected]>
Co-authored-by: Alexei Fedotov <[email protected]>
Co-authored-by: János Benjamin Antal <[email protected]>
Co-authored-by: AlexF <[email protected]>
Co-authored-by: Igor Nikonov <[email protected]>
Co-authored-by: Alasdair Brown <[email protected]>
Co-authored-by: Dominic Tran <[email protected]>
Co-authored-by: clickhouse-cloud-ci[bot] <333021140+clickhouse-cloud-ci[bot]@users.noreply.github.com>
Co-authored-by: Shaohua Wang <[email protected]>
Co-authored-by: Daniel Lemire <[email protected]>
Co-authored-by: Shankar Iyer <[email protected]>
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
@stresshouse

stresshouse Bot commented Nov 20, 2026

Copy link
Copy Markdown

📊 Cloud Performance Report

⚠️ AI verdict: not_sure — inconclusive across 29 queries analysed

PR verdict: not_sure. 9 measured difference(s) not attributable to this PR. clickbench Q4: The measured difference cannot be attributed to this PR from the available source evidence. In the pinned test merge, the only runtime change is a new early-skip in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp). It calls disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp), which returns true only when is_correlated latches. This SQL has no subquery, so the check returns false and planning and execution are the same as before. At most the PR adds one walk over a small query tree, which cannot add 14.5 ms … clickbench Q8: The measured difference cannot be attributed to this PR from the available source evidence. The PR only adds disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) and calls it early in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp). It returns true only for trees with a correlated subquery, and this SQL has none, so the plan is unchanged. The aggregation code is not touched. The cause of the shift was not identified. clickbench Q9: The measured difference cannot be attributed to this PR from the available source evidence. disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) needs is_correlated to latch, which requires a correlated subquery. This SQL has none, so the new branch in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) is never taken. The aggregation and read paths are not modified. The cause of the shift was not identified. clickbench Q12: The measured difference cannot be attributed to this PR from the available source evidence. The PR's runtime change is limited to a correlated-subquery skip in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp), backed by a dry-run DisableParallelReplicasVisitor (src/Analyzer/Passes/DisableParallelReplicasPass.cpp). This SQL has no subquery, so disablesEverywhere() is false and nothing changes. The cause of the shift was not identified. clickbench Q13: The measured difference cannot be attributed to this PR from the available source evidence. disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) returns true only when a correlated subquery is found. This SQL has none, so the new early return in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) is never taken and the plan is identical. The cause of the shift was not identified. clickbench Q14: The measured difference cannot be attributed to this PR from the available source evidence. The only runtime change is the correlated-subquery skip in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) using disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp). Without a correlated subquery the check returns false. Aggregation code is not touched. The cause of the shift was not identified. clickbench Q15: The measured difference cannot be attributed to this PR from the available source evidence. disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) only reports true for trees with a correlated subquery. This SQL has none, so the new branch in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) does nothing for it. The cause of the shift was not identified. clickbench Q18: The measured difference cannot be attributed to this PR from the available source evidence. The PR's correlated-subquery skip in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) never fires for SQL without subqueries. The dry-run visitor in src/Analyzer/Passes/DisableParallelReplicasPass.cpp returns false here, so the plan is unchanged. The cause of the shift was not identified. clickbench Q32: The measured difference cannot be attributed to this PR from the available source evidence. disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) needs a correlated subquery to return true. This SQL has none, so the new early return in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) is never taken. Hash aggregation code is not modified. The cause of the shift was not identified.

clickbench

⚠️ 10 inconclusive

Flagged queries (10 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 4 not_sure 70 85 +20.6% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. In the pinned test merge, the only runtime change is a new early-skip in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp). It calls disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp), which returns true only when is_correlated latches. This SQL has no subquery, so the check returns false and planning and execution are the same as before. At most the PR adds one walk over a small query tree, which cannot add 14.5 ms …
⚠️ 8 not_sure 223 249 +11.7% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. The PR only adds disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) and calls it early in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp). It returns true only for trees with a correlated subquery, and this SQL has none, so the plan is unchanged. The aggregation code is not touched. The cause of the shift was not identified.
⚠️ 9 not_sure 271 301 +11.1% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) needs is_correlated to latch, which requires a correlated subquery. This SQL has none, so the new branch in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) is never taken. The aggregation and read paths are not modified. The cause of the shift was not identified.
⚠️ 12 not_sure 173 204 +18.3% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. The PR's runtime change is limited to a correlated-subquery skip in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp), backed by a dry-run DisableParallelReplicasVisitor (src/Analyzer/Passes/DisableParallelReplicasPass.cpp). This SQL has no subquery, so disablesEverywhere() is false and nothing changes. The cause of the shift was not identified.
⚠️ 13 not_sure 234 274 +16.6% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) returns true only when a correlated subquery is found. This SQL has none, so the new early return in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) is never taken and the plan is identical. The cause of the shift was not identified.
⚠️ 14 not_sure 211 242 +14.9% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. The only runtime change is the correlated-subquery skip in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) using disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp). Without a correlated subquery the check returns false. Aggregation code is not touched. The cause of the shift was not identified.
⚠️ 15 not_sure 91 106 +16.5% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) only reports true for trees with a correlated subquery. This SQL has none, so the new branch in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) does nothing for it. The cause of the shift was not identified.
⚠️ 18 not_sure 374 422 +12.7% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. The PR's correlated-subquery skip in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) never fires for SQL without subqueries. The dry-run visitor in src/Analyzer/Passes/DisableParallelReplicasPass.cpp returns false here, so the plan is unchanged. The cause of the shift was not identified.
⚠️ 28 not_sure 1019 1108 +8.8% <0.0001 cpu: Borderline, and the two tests disagree. This regex-heavy GROUP BY has no subquery, so the PR does not touch its path.
⚠️ 32 not_sure 588 729 +24.0% <0.0001 aggregation: The measured difference cannot be attributed to this PR from the available source evidence. disablesParallelReplicasInWholeTree (src/Analyzer/Passes/DisableParallelReplicasPass.cpp) needs a correlated subquery to return true. This SQL has none, so the new early return in buildQueryPlanForAutomaticParallelReplicas (src/Interpreters/InterpreterSelectQueryAnalyzer.cpp) is never taken. Hash aggregation code is not modified. The cause of the shift was not identified.

Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 01e58542-0a4a-43bf-b643-108e3c72c705
  • MIRAI run: f8a9a6e0-ed95-4b65-b54b-28a5e081b573
  • PR check IDs:
    • clickbench_496681_1795191083
    • clickbench_496687_1795191083
    • tpch_adapted_1_official_496722_1795191083
    • tpch_adapted_1_official_496746_1795191083

@nickitat
nickitat added this pull request to the merge queue Nov 24, 2026
Merged via the queue into master with commit 1e0ef16 Nov 24, 2026
198 checks passed
@nickitat
nickitat deleted the autopr-remember-unmatchable branch November 24, 2026 11:26
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 24, 2026
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 24, 2026
robot-ch-test-poll2 added a commit that referenced this pull request Nov 24, 2026
Cherry pick #129544 to 26.10: Skip the probe plan when a correlated subquery rules out parallel replicas
robot-clickhouse added a commit that referenced this pull request Nov 24, 2026
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 24, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 24, 2026
Backport #129544 to 26.11: Skip the probe plan when a correlated subquery rules out parallel replicas
clickhouse-gh Bot added a commit that referenced this pull request Nov 24, 2026
Backport #129544 to 26.10: Skip the probe plan when a correlated subquery rules out parallel replicas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo v26.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants