Skip to content

Run the text_index_postprocessor_filter performance inserts on 500k rows - #131857

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-text-index-postprocessor-filter-500k
Nov 16, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-text-index-postprocessor-filter-500k

Conversation

@groeneai

@groeneai groeneai commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129258

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):

...

Description

The four entries of text_index_postprocessor_filter.xml take 1.07-1.27 s on MasterCI amd and 1.01-1.19 s on arm. Each INSERT reads 3M rows of 30 words and writes them as three parts of about 1M rows in parallel, so a run takes about as long as one part's text index build and write. Half the rows would still write a part of about 1M rows.

No existing query number or text changes: 2 queries (4 entries with the substitution) are disabled and 2 copies (4 entries) appended as 4-7. The copies run the same INSERTs into the same target tables, reading the first 500k of the same rows: the 3M source fill is read only by the disabled queries, so it is renamed and resized in place. Each copy writes one part of 500k rows; locally its per-row index build and compression times are within 1.5% of its original's, with the same bytes per row and the same index share of the part write.

On the MasterCI builds before and after #111690, which CI itself measured at 1.28-1.40x on amd, the copies keep 0.77-1.05 of the original's speedup locally, in both seat orders and in two repetitions on different NUMA nodes, with L3 capped to one way.

The copies should take about 0.4-0.6 s on both architectures: about 25 s less query time per master perf job on each, and the setup fills 1.5M rows instead of 9M. The copies restart the history of 4 entries.

Validation: perf.py on the final file runs only entries 4-7, also with CI's --max-queries 10, with no run trend.

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.11.1.2410-master (included in 26.11 and later)

All four entries of tests/performance/text_index_postprocessor_filter.xml
take 1.07-1.27 s on MasterCI (amd, arm 1.01-1.19 s). Each INSERT reads 3M
rows and writes three ~1M-row parts in parallel, so a run takes about one
part's text index build and write; half the rows would still write a
~1M-row part.

No existing query number or text changes: 2 queries (4 entries with the
substitution) are disabled and 2 copies (4 entries) appended as 4-7. The
copies read the first 500k of the same rows (the source fill is renamed
to tab_src_500k_{drop_pct}, read only by the copies) and write one part
of 500k rows into the same target tables.

Local A/B on official builds, two repetitions on different NUMA nodes,
L3 capped to one way (decide.py v2: every gate passes in both):
- per-row index and compression time of a copy 0.986-1.009 of its
  original, bytes per row 1.000, index share of the part write +-0.002;
- local time ratio copy/original 0.421-0.462 -> projected CI medians
  0.45-0.58 s amd, 0.42-0.54 s arm;
- on the MasterCI builds before and after ClickHouse#111690 (608eeb8 -> 04971e1,
  CI measured 1.28-1.40x on amd), the copies keep 0.77-1.05 of the
  original's speedup, both seat orders.
Saving: about 25 s of query time per master perf job on each
architecture; the setup fills 1.5M instead of 9M rows.

Related: ClickHouse#129258

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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; 1 finding), plus my own review (0 findings).

# Sev Finding Verdict Evidence / action
1 ⚠️ No reviewable evidence that the 500k-row copies keep the sensitivity to #111690 on both CI architectures (text_index_postprocessor_filter.xml:50-55) DISAGREE amd, recorded: per-run perf.py times of entries 0-3 and 4-7 on the MasterCI builds before and after #111690, both seat orders, two repetitions on different NUMA nodes: originals 1.28-1.43x, copies 1.28-1.37x (0.77-1.05 of the effect). A copy's per-row MergeTreeDataWriterSkipIndicesCalculationMicroseconds is 0.99-1.01 of its original's (it builds the text index), and the growing target tables show no run trend. arm: projected only, as the PR body says; a copy changes only the input size, and its per-row costs did not depend on it on amd.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding.

Session id: cron:clickhouse-review-slot-9:20261115-183800

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @egor-click, could you review this? Run the four text_index_postprocessor_filter perf INSERTs on 500k rows instead of 3M (2 queries disabled, 2 copies appended as entries 4-7)

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. MasterCI medians 1.005-1.269 s for all four entries (71 commits); every local pass on the official master build: originals 0.99-1.42 s, copies 0.43-0.55 s.
b Root cause explained? Input size: each INSERT writes 3M rows as three ~1M-row parts in parallel, so a run costs one part's text index build and write. Half the rows would still write a ~1M-row part.
c Fix matches root cause? Yes. The copies change only the input size, to one part of 500k rows; per-row index and compression times stay within 1.5%, bytes per row and index share unchanged.
d Test intent preserved / new tests added? Yes. Same INSERT text, same target tables and postprocessors (three drop rates and NOT IN), first 500k of the same rows. No functional test (perf-test-only change).
e Both directions demonstrated? Yes. On the builds before/after #111690 the originals speed up 1.28-1.43x and the copies 1.28-1.37x (retention 0.77-1.05), both seat orders, two repetitions on different NUMA nodes.
f Fix is general across code paths? N/A (test-only, no source change).
g Fix generalizes across inputs (params/datatypes/wrappers)? Each drop_pct expansion (8, 35, 85) and the NOT IN form is checked separately; all four pass.
h Backward compatible? (maintainer-approved exception only) Yes. No setting or format change; entries 0-3 keep their text and numbers (disabled), copies take fresh numbers 4-7.
i Invariants and contracts preserved? Yes. Existing query texts and order unchanged, copies appended after the last query, every source fill has an enabled reader, all 4 enabled entries run under --max-queries 10, no run trend.

Session id: cron:clickhouse-impl-slot-4:20261115-182800

@clickhouse-gh

clickhouse-gh Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3820937]

Summary: ✅


AI Review

Summary

PR #131857 replaces four 3M-row text-index performance entries with 500k-row copies, preserving the original query texts and numbers as disabled entries. Reviewed head 3820937f66c81763737c228cf6a08ec11bf804b9; no actionable findings.

Missing context / blind spots
  • ⚠️ Server benchmarks were not independently rerun because this environment has no clickhouse binary. Timing and sensitivity evidence comes from the author's documented amd measurements; arm timings remain projections. An arm benchmark run would verify those estimates.
Final Verdict

✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 15, 2026
@clickhouse-gh clickhouse-gh Bot added can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). labels Nov 15, 2026
@alexey-milovidov alexey-milovidov self-assigned this Nov 16, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 16, 2026
Merged via the queue into ClickHouse:master with commit a75c7d7 Nov 16, 2026
384 of 385 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 16, 2026
@clickhouse-gh clickhouse-gh Bot added comp-text-index Full-text search: inverted/text index in MergeTree (tokenizers, posting lists, GIN-style index bu... 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-text-index Full-text search: inverted/text index in MergeTree (tokenizers, posting lists, GIN-style index bu... 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.

3 participants