Repository navigation
Give the array_join String benchmark a sink so it measures replication, not its result transfer - #119215
Conversation
tests/performance/array_join.xml query 6 has no sink, alone among the seven queries of that file, so it returns all 45,000,000 result rows to the client: 540 MB on the wire, and 94-97% of its wall clock blocked in network send (UserTimeMicroseconds 0.51 s of a 6.42 s run). That transfer is what its 7090 ms amd p50 measures, against 47-275 ms for queries 0-5 in the same file, a documented ideal of 0.1-1 s and report.py's 2 s flag. Its tail also crosses perf.py's 15 s per-run cap, and the resulting Code 159 ends the whole test file, leaving the other six queries unmeasured. tests/performance/scripts/README.md:64-66 names the class, "a forgotten format Null". Two settings are appended to that one query, nothing else changes: format Null discards the result, so 540,088,942 bytes on the wire become 81 and the query goes from 6.479 s to 0.092 s. enable_lazy_columns_replication = 0 keeps the benchmark on its subject. The query uses the arrayJoin function form and query_plan_lower_array_join_function is off by default, so the expansion runs in ExpressionActions, which wraps the String passenger in a lazy ColumnReplicated; without the pin only 12.5% of the run is spent in ColumnString::replicate (562 of 4752 sampled frames), with it 63% (2478 of 6100). array_join_filter_fusion.xml:26 pins the same setting for the same reason, and the lazy path keeps its own coverage in five other perf tests. Measured with the master amd_release binary at the perf job's own configuration (max_threads=8, 8 pinned physical cores, the perf users profile), a rig whose medians sit within 11% of the shard's CIDB p50 on all seven queries of the file. Through perf.py the file's run stage drops from 53.5 s to 8.4 s with all 7 queries measured. numbers(10000000), the projection and the expansion are untouched, so the replicated volume is what it has been since 2024. Query 6's measurement changes meaning, so its per-query history is incomparable across this commit. Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Independent pre-publication review (engine: codex, 1 finding) plus my own cold pass (4 findings). No blocker.
Severity: ❌ blocker / If query 6 does come back Session id: cron:clickhouse-review-slot-9:20260910-113200 |
|
cc @yariks5s, could you review this? |
|
Workflow [PR], commit [4d00734] Summary: ✅
AI ReviewSummaryThis PR turns the last unsinked query in Final VerdictStatus: ✅ Approve |
382315b
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Performance test
array_joinquery 6 no longer returns its 45M-row result to the client, so it measures the String replication it was written for instead of the transfer.Description
Performance Comparison (amd_release, master_head, 6/6)went red becausearray_joinquery 6 hitperf.py's 15 s per-run cap (
Code: 159, elapsed 15047 ms) and the raise ended the whole test file, sothe other six queries went unmeasured too. Failing report:
https://s3.amazonaws.com/clickhouse-test-reports/PRs/117841/cd367912710f933989029b2e7e808bdff049209c/pr/performance_comparison_amd_release_master_head_6_6/report.html
That query has no sink, alone in the file, so it ships all 45,000,000 result rows to the client: 540 MB
on the wire, and 95.9% of the failing run in
NetworkSendElapsedMicroseconds. Its amd p50 is 7090 msagainst 47-275 ms for queries 0-5, past
report.py's 2 s flag on every run, andscripts/README.md:64-66names the class ("a forgottenformat Null").I appended two settings to that one query and changed nothing else. Measured on the master
amd_releasebinary at the perf job's configuration (max_threads=8, 8 pinned cores), on a rig within11% of the shard's CIDB p50:
format Nullremoves the transfer: 540 MB on the wire becomes 81 bytes, 6.479 s becomes 0.092 s.enable_lazy_columns_replication = 0keeps the benchmark on its subject. This is thearrayJoinfunction form and
query_plan_lower_array_join_functionis off by default, so the expansion runs inExpressionActions, which wraps the String passenger in a lazyColumnReplicated: the pin movesColumnString::replicatefrom 12.5% to 63% of sampled frames. Precedent:array_join_filter_fusion.xml:26.Through
perf.pythe file's run stage drops from 53.5 s to 8.4 s, all seven queries measured. Thedefault lazy path keeps its coverage in
lazy_columns_replication,array_join_lazy_replication_serialized_plan,lambda_captures_lazy_replication,lazy_replicated_array_functionsandarray_join_filter_fusion. Query 6's measurement changesmeaning, so its per-query history is incomparable across this commit.
If both paths should stay covered here, I will parameterize the setting over
0/1aslambda_captures_lazy_replication.xmldoes rather than pin one arm.Not fixed here: the harness itself still lets one over-budget query end its test file.
Workflow [PR]
Sync PR [sync-upstream/pr/119215]
Version info
26.9.1.1259(included in26.9and later)