Skip to content

Run the JSONEachRow and Avro queries of formats_columns_nullable on a quarter of the rows - #132357

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-formats-columns-nullable-quarter
Nov 17, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-formats-columns-nullable-quarter

Conversation

@groeneai

@groeneai groeneai commented Nov 17, 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 JSONEachRow and Avro expansions of queries 0 and 2-10 of formats_columns_nullable.xml (20 entries) take 1.00-2.51 s on MasterCI amd and 1.09-2.90 s on arm. Each reads all 2M rows of its File table: Avro decodes them on one thread, JSONEachRow parses a 1 GB file.

No existing query number or text changes: the 11 queries (entries 0-87) are disabled and 22 (88 entries) appended as 88-175. As in #132174, the marker covers all eight formats of a query, so the 66 sub-second entries return verbatim through {fast_format}, and the 22 JSONEachRow / Avro ones run through {slow_format} on new _500k tables, written by the same create and fill on id < 250000 (Avro still 2 files, JSONEachRow one, read whole with default parallel parsing as #123691 set up). Master's 2M-row JSONEachRow / Avro tables are no longer created: only the disabled entries read them.

Per row the copies take 0.98-1.04 of the originals' user time, on master and on both builds of #119039. Across #119039, which moved Avro entry 19 by 6.7% in its MasterCI comparison, the Avro originals moved 1.048-1.056 locally and their copies 1.044-1.058; the JSONEachRow originals 1.0172 and their copies 1.0145, the median over the ten. The copies take 0.25-0.30 of the originals' time, at most 0.635 s projected on amd and 0.733 s on arm.

That is about 21 s less query time per master perf job on amd and 23 s on arm, and about 2.6 s less setup. They restart the history of the file's 88 entries.

Validation: on the final file perf.py runs only entries 88-175 (also with --max-queries 10).

🤖 Generated with Claude Code


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

Version info

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

…` on a quarter of the rows

The `JSONEachRow` and `Avro` expansions of queries 0 and 2-10 (20 entries) took 1.00-2.51 s
on MasterCI amd and 1.09-2.90 s on arm: each reads all 2M rows of its `File` table, `Avro` on
one thread, `JSONEachRow` from a 1 GB file.

No existing query number or text changes: the 11 queries (entries 0-87) are disabled and 22
(88 entries) appended as 88-175. The 66 sub-second entries return verbatim through
`{fast_format}`; the 22 `JSONEachRow` / `Avro` ones run through `{slow_format}` on new `_500k`
tables written by the same create and fill on `id < 250000` (`Avro` still 2 files,
`JSONEachRow` one, read whole with default parallel parsing). Master's 2M-row `JSONEachRow` /
`Avro` tables are no longer created: only the disabled entries read them.

Local A/B on official builds across ClickHouse#119039 (845c709 -> 8a7ac31):
- `Avro` (2 swapped passes, 12 runs): originals moved 1.048-1.056, copies 1.044-1.058
  (retention 0.87-1.12); per-row user time copy / original 0.998-1.024.
- `JSONEachRow` (4 swapped passes, 20 runs): median over the ten, originals 1.0172, copies
  1.0145 (pooled retention 0.84), no pair apart by more than 0.015; per row 1.000-1.016.
On the base build the copies take 0.25-0.30 of the originals' time (per row 0.98-1.04), at
most 0.635 s projected on amd and 0.733 s on arm; the 66 verbatim copies 0.88-1.31 of their
originals (median 1.000).

About 21 s less query time per master perf job on amd and 23 s on arm (8 runs per copy;
26 / 28 s at CI's 5), and about 2.6 s less setup.

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; 0 findings) plus my own review of the same head (0 blockers, 0 majors, 2 nits, not blocking).

# Sev Finding Verdict Evidence / action
1 💡 The description quoted the per-row user-time ratio of the #119039 builds only AGREE, fixed The description now gives 0.98-1.04, which also covers the master build (0.978-1.035)
2 💡 The count() copies (entries 94-99, 156-157) run in about 2 ms, below the README's 0.1 s DISAGREE They copy master's query 1, whose entries 8-15 also take 1.7-1.9 ms; the series appends copies and does not change existing queries

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

Session id: cron:clickhouse-review-slot-11:20261117-124600

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? N/A as a failure; the cost reproduces: the 20 JSONEachRow / Avro entries take 1.00-2.51 s on MasterCI amd (CIDB medians since 2026-11-13) and 1.19-2.30 s on my rig with the official master build.
b Root cause explained? Input size: each entry reads all 2M rows of its File table; Avro decodes them on one thread, JSONEachRow parses one 1 GB file. Not a regression.
c Fix matches root cause? The copies read a quarter of the rows through the same engine and format, the same file count, whole files with default parallel parsing (no LIMIT).
d Test intent preserved / new tests added? Per row the copies take 0.98-1.04 of the originals' user time on three official builds; the #119039 effect is kept (Avro per entry, JSONEachRow pooled); the 66 fast entries are verbatim. No harness test (#119766).
e Both directions demonstrated? Across #119039 (845c709 -> 8a7ac31) the originals and their copies move together: Avro 1.048-1.056 vs 1.044-1.058, JSONEachRow 1.0172 vs 1.0145 (median of ten, four swapped passes of 20 runs).
f Fix is general across code paths? N/A (test-only). Every entry above 1 s is covered; the count() copies stay at 2 ms.
g Fix generalizes across inputs (params/datatypes/wrappers)? All 8 formats x 11 queries kept; id < 250000 keeps every column type and NULL rate.
h Backward compatible? (maintainer-approved exception only) No setting, engine, perf.py or CI change. The 88 entries restart their history (said in the description).
i Invariants and contracts preserved? Entries 0-87 keep their text and index, exactly 0-87 are disabled, and the setup drops only the tables that the disabled entries alone read (checked with perf.py --print-queries and a run of the final file).

Session id: cron:clickhouse-impl-slot-4:20261117-114501

@clickhouse-gh

clickhouse-gh Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [51cfa8a]

Summary: ✅


AI Review

Summary

PR #132357 reduces the JSONEachRow and Avro performance-test datasets to 500,000 rows, preserving the original query indices and appending replacements for all eight formats. The reported measurements support the runtime reduction and retained regression sensitivity. No actionable findings.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 17, 2026
@Algunenano Algunenano self-assigned this Nov 17, 2026
@Algunenano
Algunenano added this pull request to the merge queue Nov 17, 2026
Merged via the queue into ClickHouse:master with commit 5c971c3 Nov 17, 2026
385 of 386 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 17, 2026
@clickhouse-gh clickhouse-gh Bot added comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). 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-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). 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