Skip to content

Stabilize the mixed_01_clustered queries of the lower_upper_utf8_mixed_ascii performance test - #122728

Merged
egor-click merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/lower-upper-utf8-block-size
Sep 28, 2026
Merged

egor-click merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/lower-upper-utf8-block-size

Conversation

@groeneai

@groeneai groeneai commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #120510
Related: #119790

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

Not required: CI-only change.

Description

lower_upper_utf8_mixed_ascii #4/#5 (lowerUTF8/upperUTF8 of mixed_01_clustered) take one of two times on the same code. On #120510 the dashboard scored #4 +18% as a confirmed regression (arm 5/6); master too, arm 6/6 @ ce3a5d0e: 12.7 -> 15.2 ms. In 14 days #4 moved over 15% in 56 of 1171 arm runs, #5 in 43 of 1146, every other query at most twice.

Each server process runs #4/#5 at one of two levels, about 4500 or 6450 minor page faults per execution; the high level adds 2 ms of system time on arm (~17% of the 12 ms query), 2.7 ms on amd, same user time. mixed_01_clustered has all its non-ASCII rows in the first block, so it is the only column whose full blocks take both result reservations of LowerUpperUTF8Impl: the non-ASCII path reserves the next power of two, 16 MiB for a 65536-row block of 128-byte values plus 127 bytes of padding, the all-ASCII path exactly 8 MiB + 127 bytes. perf.py purges jemalloc before every run.

I set max_block_size to the default 65409 (DEFAULT_BLOCK_SIZE, 65536 minus that padding): a block stays below 8 MiB and both paths get 8 MiB. mixed_01_block_tail follows the block size, keeping its 64 non-ASCII rows at the end of every full block. Row length, block count, query order and every case are unchanged.

Locally (x86, official master build, CI server config, 20 repetitions of two fresh servers per fixture): with the old fixture 33 of 40 server processes ran #4/#5 at the high level, with the new one none; #4/#5 memory now equals #0/#1 (17.0 MiB, was 24.6), their client time is 12% lower, and the user CPU of the other six measured queries is within 2%. In 12 complete-test repetitions per fixture no other query moved.

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.10.1.949-master (included in 26.10 and later)

`lowerUTF8`/`upperUTF8` of `mixed_01_clustered` (queries ClickHouse#4/ClickHouse#5) ran at one of
two levels per server process in Performance Comparison, about 1900 minor
page faults and 2 ms of system time apart, which is ~17% of the 12 ms arm
query. That column keeps all its non-ASCII rows in the first block, so it is
the only one whose query takes both result reservations of
`LowerUpperUTF8Impl`: the non-ASCII path rounds up to a power of two, 16 MiB
for a 65536-row block of 128-byte values plus 127 bytes of padding, while the
all-ASCII path reserves exactly 8 MiB + 127 bytes. perf.py purges jemalloc
before every run, so each run touches its pages afresh.

Run the test at the default block size, 65409 rows (`DEFAULT_BLOCK_SIZE`,
65536 minus that padding): a block stays below 8 MiB and both paths get
8 MiB. `mixed_01_block_tail` follows the block size, so its 64 non-ASCII rows
are still the last rows of every full block. Row length, block count, query
order and every case are unchanged.

Local A/A with the official master build and perf.py: the old fixture shows
the split in 33 of 40 server processes, the new one in none, and no query of
the test moved in 12 complete-test repetitions per fixture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-review-human PR origin: human review feedback on a groeneai PR labels Sep 28, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex): 0 findings on this head. My own cold review of the diff, done before reading the implementation's evidence, found no blocker or major; its three nits (wording in this description: which columns take both result paths, the 14-day move counts, the system-time delta) were fixed before publication.

Session id: cron:clickhouse-review-slot-8:20260928-175900

@clickhouse-gh

clickhouse-gh Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4705a7e]

Summary: ✅


AI Review

Summary

This PR adjusts the lower_upper_utf8_mixed_ascii performance fixture to use the default max_block_size (65409) and re-aligns mixed_01_block_tail so the tail-case still keeps 64 non-ASCII rows at the end of each full block. I found no correctness, contract, or PR-metadata issues in the current head; the fixture math matches the in-tree DEFAULT_BLOCK_SIZE, ColumnString storage layout, and the LowerUpperUTF8Impl reservation behavior the change is targeting.

Final Verdict

Status: ✅ Approve

@egor-click
egor-click added this pull request to the merge queue Sep 28, 2026
Merged via the queue into ClickHouse:master with commit fce399f Sep 28, 2026
149 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 28, 2026
@clickhouse-gh clickhouse-gh Bot added comp-regular-function Regular scalar functions: string processing, data conversion, arithmetic, math, comparison, condi... and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-regular-function Regular scalar functions: string processing, data conversion, arithmetic, math, comparison, condi... groeneai-origin-review-human PR origin: human review feedback on a groeneai PR pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants