Repository navigation
Run the all-unique-pattern queries of re2_regex_caching on a quarter of their rows - #132233
Merged
Algunenano merged 1 commit intoNov 18, 2026
Conversation
…r of their rows No existing query number or text changes: 2 queries (entries 2-7) are disabled and 4 (6 entries) appended as 8-13. The `disabled` marker covers every expansion of a query, so the four low-distinctness patterns return verbatim as 9, 10, 12, 13 through two new substitutions. Entries 2 and 5 (`like` / `match` with an all-unique non-constant pattern) compile one regexp per row of `numbers_mt(1500000)` and take 1.79 / 1.57 s on MasterCI amd, 1.30 / 1.15 s on arm. Their copies (8, 11) run on every 4th number of the same range, `numbers_mt(0, 1500000, 4)`, with `max_block_size = 16384`: the same 23 blocks, a quarter of the rows each, one compilation per row (375000 regexp cache misses) and a full 1000-bucket local cache per block. Probe on official builds (paired user time, n = 12): per row the copies take 0.97-1.01 of the originals' user time; the ClickHouse#119039 merge moved the originals by 1.029 / 1.028 and the copies by 1.027 / 1.027, the ClickHouse#117346 merge 0.960 / 0.976 and 0.964 / 0.970 (MasterCI: 1.03-1.05 and 0.97-0.99). In a local perf.py run the copies take 0.253 / 0.254 of the originals' time; projected onto MasterCI that is 0.45 / 0.40 s on amd and 0.33 / 0.29 s on arm, about 30 s (amd) and 22 s (arm) less query time per master perf job. Related: ClickHouse#129258 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (0 findings). Nothing to adjudicate. Session id: cron:clickhouse-review-slot-9:20261117-044101 |
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261117-043000 |
Contributor
|
Workflow [PR], commit [435df0a] Summary: ✅
AI ReviewSummaryThe PR reduces the all-unique-pattern Missing context / blind spots
Final VerdictStatus: ✅ Approve |
27 of 39 tasks
Algunenano
approved these changes
Nov 18, 2026
Merged
via the queue into
ClickHouse:master
with commit Nov 18, 2026
3f8a4d3
385 of 386 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #129258
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
The
likeandmatchqueries ofre2_regex_caching.xmlwith an all-unique non-constant pattern (entries 2 and 5) take 1.79 / 1.57 s on MasterCI amd and 1.30 / 1.15 s on arm. Both compile one regexp per row, the miss path of the local regexp cache the file was written for (#37544); every other entry takes 0.01-0.04 s.No existing query number or text changes: 2 queries (entries 2-7) are disabled and 4 (6 entries) appended as 8-13. The marker covers all expansions, so the four low-distinctness patterns return verbatim as 9, 10, 12, 13 through two new substitutions, and the all-unique ones run on every 4th number of the same range with
max_block_size = 16384: the same 23 blocks, a quarter of the rows each, still one compilation per row.Per row the copies take 0.97-1.01 of the originals' user time. The two MasterCI comparisons that moved both entries on both arches, the merges of #119039 (stack canaries, 1.03-1.05) and #117346 (clang 23, 0.97-0.99), moved the originals locally by 1.028-1.029 and 0.960-0.976, the copies by 1.027 and 0.964-0.970 (official builds, paired user time, 12 runs).
In a local
perf.pyrun the copies take 0.25 of the originals' time: projected about 0.45 / 0.40 s on amd and 0.33 / 0.29 s on arm, so about 30 s (amd) and 22 s (arm) less query time per master perf job. They restart the history of these 6 entries.Validation: on the final file
perf.pyruns only entries 0, 1 and 8-13 (also with--max-queries 10 --soft-max-queries), with 375000 regexp cache misses per execution of 8 and 11.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/132233]
Version info
26.11.1.2758-master(included in26.11and later)