Skip to content

kv: run the CH-benCHmark queries beside the tpcc terminals and on their own - #277

Merged
tamnd merged 1 commit into
mainfrom
ch-benchmark
Oct 9, 2026
Merged

tamnd merged 1 commit into
mainfrom
ch-benchmark

Conversation

@tamnd

@tamnd tamnd commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Part of tamnd/rudb#1390 (W7), the CH-benCHmark driver: TPC-C with analytic streams running the 22 queries.

The tpcc mode ran the TPC-C terminals and nothing else, so W7's gates (NOPM with one analytic stream at least 80% of NOPM without, and each CH query at most 1.5x its time on a load-once copy) could not be measured. This adds both runs of bench/tpc-c/09-ch-benchmark.md.

The load now makes twelve tables: the nine of TPC-C plus region (5 rows), nation (62 rows) and supplier (10,000 rows), as BenchBase makes them. The query texts in the new kv/src/tpcc/ch.rs are BenchBase's at revision 33c00473, with oorder named orders and every date literal moved on 14 years, from 2012 to the year of the load timestamp. Q15 reads a view of each stream's own, revenueN, so two streams do not make and drop one view between them.

--analytic N runs N streams beside the terminals. Each stream opens a session, sets its threads (SET threads on rudb, max_parallel_workers_per_gather on PostgreSQL) to --analytic-threads, 2 unless set, prepares the 22 and runs them in a shuffled order each pass until the window ends, counting only runs that start inside it. A query the engine cannot prepare is printed as ch unprepared and skipped. --mode ch is the load-once reference: each query --runs times, 5 unless set, on one session.

Both print a ch streams= threads= texts_sha256= benchbase= shift_years= line, then a ch query=Qn n= median_ms= q1_ms= q3_ms= min_ms= max_ms= rows= errors= hist_us= line for each query, a ch error line for each query that failed, and ch summary streams= passes= answered= geomean_ms=, with qph= and qph_per_stream= in the mixed run. The ratios against the references come from comparing reports, not from the driver. For example rudb-bench-kv --mode tpcc --backend rudb --target t.db --load --warehouses 2 --terminals 4 --analytic 2, then rudb-bench-kv --mode ch --backend rudb --target t.db.

Tests

  • main.rs: --analytic and --analytic-threads parse in the tpcc mode, --mode ch takes --runs with 2 threads by default, and zero runs, zero threads, or --analytic outside the tpcc mode are refused.
  • ch.rs: every date moves on 14 years and nothing else does, each stream's Q15 reads its own view, the three added tables have their rows (62 nation keys, 10,000 suppliers), and the report has a line a query and each error once.
  • A run on server3 against rudb: results to follow in a comment.

@tamnd tamnd added kind/feature It should do something it does not. area/tpc TPC-H and TPC-DS. labels Oct 9, 2026
@tamnd
tamnd merged commit ff0ec14 into main Oct 9, 2026
1 check failed
@tamnd
tamnd deleted the ch-benchmark branch October 9, 2026 12:55
@tamnd tamnd mentioned this pull request Oct 12, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tpc TPC-H and TPC-DS. kind/feature It should do something it does not.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant