Repository navigation
Description
Is there an existing issue for performance?
- I have checked the existing issues.
This is a focused SF10 all-memory follow-up to #30569. It establishes zero physical I/O and publishes a fresh comparison with fine profiling.
Measurement correction — 2026-10-27: The historical worker f881dfc604c11c29067ec5ccfcabbeeb357f40bc validated declared dataset/result schemas and query metadata, then normalized, counted, serialized and SHA-256-hashed result rows during timed execution (legacy manifest checks and timed result capture). The query replays did not run full input-table verification or compare results against a reference. Earlier statements that these runs performed no schema checks or result hashing were wrong. Their recorded times include client capture work; its effect on the comparisons has not been quantified. Subsequent benchmarks must execute and drain without these checks or capture.
SF100 server129 update — 64 logical CPUs, 192 GiB MO cache
The separate SF100 comparison is complete: MO 76.199567 s vs DuckDB 14.811365 s, 5.144669× (paired 95% CI 5.108797–5.169426), ten balanced pairs / 440 timed queries. Cold warmups are excluded. Every scored window has zero physical I/O, spills and swap, with both applications capped at 200 GiB and native images in charged tmpfs. MO's CN SHARED cache is configured to 192 GiB; this is capacity, not proof of full decoded-cache residency.
Full SF100 results, measured conclusions and per-query downloads · Individual compressed results/profiles and file sizes. This publication now contains all 44 native profiles and 44 CPU recordings, covering Q1–Q22 on both engines. The remaining 23 CPU recordings and their diagrams/counters were uploaded on 2026-10-23; the original partial snapshot is superseded. Comprehensive cross-query findings and optimization subtasks. Q1 retires 16.4× more instructions; the profiles also identify hash probing, decoding, copying and allocation costs. SF100 runs on different hardware/resources from the original SF10 report below, so their differences are not scale-only effects.
Environment
- CPU: AMD Ryzen 9 7950X3D, 16 physical cores/32 logical CPUs. Both applications use the same eight physical cores (CPU 0–7); controller uses 8–15. SMT siblings exist; the host is shared, and the unrelated local Astra MO is left running.
- RAM: about 62 GiB host RAM; 32 GiB total application cgroup limit per engine, including database files on tmpfs, temporary files, logs/results and all MO services/client or DuckDB/worker. Benchmark
memory.swap.max=0. - OS: Linux 7.2.10-1-cachyos x86_64; existing powersave governor and frequency boost retained for both.
- MO: native CPU build at
873282742714436bff407dfcdbbe879147162bd3; exact prior executable SHA-2561e0c54088b691692c60cb1ba28c0838ee3971265096cba47c104443c4d5971c4. BuildMO_SIRIUS=0 MO_CL_CUDA=0, optimized GOAMD64=v3/GOEXPERIMENT=simd; optional jemalloc C++ shim disabled for host compiler.GOMAXPROCS=8,GOGC=100,agg_spill_mem=2147483648, result saving off; original 512 MiB file-service cache defaults retained. - DuckDB: v1.5.6, source
069cc9f9b5be802405797faecc284961b07c70ef, duckdb-go/v2 v2.10506.0;threads=8, internal memory target 80% of the application limit (readback 25.5 GiB). - Shared worker: source
f881dfc604c11c29067ec5ccfcabbeeb357f40bc, exact prior executable SHA-2563e6b0a97f70050579008fcf730326b7da44c050bf8ac5409a835034f757fffa2. - Workload: SF10 generated once with DBGEN 2.17.3 at
852ad0a5ee31ebefeed884cea4188781dd9613a3; original QGEN qualification SQL, schema/decimal types/keys, UTC/session semantics, and Q15 create-view/SELECT/drop-view lifecycle. Both load the same generated files. The legacy worker behavior and the limits of these timings are corrected above.
Details of Performance
Performance acceptance and current optimization status (2026-10-23)
This issue publishes comparison/measurement evidence. A completed arm, zero-I/O/spill/swap resource window, profiler success, passing tests or a merged harness PR establishes only that named execution/measurement gate. It does not establish that MO improved, that a proposed optimization has no regression, or that any optimization issue is complete. Historical engine ratios remain tied to their original software and configurations.
The optimization umbrella's performance gate applies to every claimed fix. Current audited decisions:
| Issue / recent PR | Performance acceptance | Required follow-up |
|---|---|---|
| #30839 / #30880 (merged) | FAIL: all-NULL casts +0.69–3.64% | Preserve empty/NULL fast paths while keeping non-NULL gains; rerun controls and target queries. |
| #30849 / #30884 (merged) | FAIL: uncompressed +8.57%, LZ4 +1.55% | Remove or redesign unconditional attribution cost; actual decoded-reuse improvement remains open. |
| #30840 / #30885 (merged) | FAIL: unknown/wide one-row multiply +2.51% / +2.95% | Correct scalar/unknown-domain dispatch costs while retaining bulk gains. |
| #30847 / #30886 | Original optimization failed and withdrawn: reordered 256-row calls +14.65% | Current PR is test-only; SUM optimization and demonstrated Q18 improvement remain open. |
| Other 14 optimization subtasks | Not yet performance-accepted | Deliver each issue's named improvement and clear its own target/control matrix. |
Performance acceptance required for a claimed improvement:
- Freeze the claimed target, real callers, benchmark cases, baseline/candidate source and executable identities, and effective settings before scoring. Rebaseline against current main and distinguish prerequisite changes from this fix.
- Demonstrate an attributable reduction in the issue's named work/CPU/resource cost and an improvement in uninstrumented target-query latency or throughput. A profile percentage, plan change, microbenchmark win or predicted speedup alone does not complete the issue.
- Every affected workload and negative control must clear the no-regression gate. A confirmed slowdown is FAIL, including scalar, tiny, empty/all-NULL, fallback and diagnostic-overhead cases. Gains elsewhere or a favorable average do not cancel it. An unresolved suspected slowdown is INCONCLUSIVE, not PASS. No slowdown tolerance or instrumentation-cost exception may be self-approved.
- Use actual caller batch sizes and supported shapes; include constants, NULLs, tails, mixed types/ranges, distributions and fallback paths where applicable. Setup/dispatch/index/conversion costs are included. A large synthetic call cannot substitute for the production caller.
- Use matched host, images, CPU/NUMA/thread settings, application cap and effective cache configuration; balanced repeated warm before/after runs with uncertainty and retained samples. Exclude the cold run and keep profiling separate from latency scoring. Confirm suspected regressions with a longer independent balanced run; retain all samples and explanations.
- Report target and control latency/throughput, CPU/instructions, allocations/copies and relevant work counts, physical I/O, spills, swap, pressure and peak accounted memory. Stay within the same whole-application budget; any proposed resource/performance tradeoff requires explicit approval. All-memory admission requires zero measured physical I/O/spill/swap and no OOM or sustained memory-pressure failure.
- Before issue closure, run the target/control comparisons at SF10 and SF100 wherever the original problem applies, and complete a Q1–Q22 regression comparison for the affected memory/mixed-I/O configurations. Missing campaigns or unresolved regressions keep acceptance pending; a partial PR does not close the issue.
- Publish scoped per-case verdicts and before/after measurements with identities, samples/intervals and relevant profiles. Functional UT/BVT, SCA, measurement completion, PR approval and merging are separate gates. Benchmark scripts execute/drain and collect completion/resources only; no input/table/schema/row-count/reference/result verification, checksum or sampling substitutes.
The umbrella contains the published confirmation samples, source/workload identities, method and explicit case-level failures. Functional/correctness qualification remains separate from benchmark execution, as required. Original scored tables/profile links below are preserved as historical evidence, not silently re-labelled as current-main measurements.
Complete Q1–Q22 suite: MO 11.873838s vs DuckDB 2.105494s; MO/DuckDB 5.639×, 95% paired bootstrap CI 5.566–5.718×.
Ten paired complete suites, five MO-first and five DuckDB-first. Each trial starts from the same frozen native image staged inside its measured cgroup onto tmpfs. One engine runs at a time. A full Q1–Q22 warmup is excluded, then queries are timed through complete result consumption. Data, logs and output captures remain in RAM during timing and are archived after completion; every temporary RAM image is removed after process join. This preserves native file formats and execution paths. No production code changes were made.
| Measured property | MO | DuckDB |
|---|---|---|
| Median suite CPU-seconds | 80.159 | 14.428 |
| Median occupied cores | 6.75 | 6.85 |
| Maximum timed-window application memory, GiB | 19.505 | 8.781 |
| Physical read bytes, sum of 10 runs | 0 | 0 |
| Physical write bytes, sum of 10 runs | 0 | 0 |
| Spill-file events, sum of 10 runs | 0 | 0 |
| Benchmark swap bytes | 0 | 0 |
| Memory-pressure stall time in scored windows | 0 | 0 |
Minor background code/cache page housekeeping is recorded separately; all scored windows have zero direct reclaim and zero memory-pressure stalls. Native ReadSize/file-service byte counters describe logical data processing and are distinct from the physical I/O counters above.
All 22 queries
Times are medians of ten samples per engine. Ratios above one mean MO is slower; intervals use 10,000 paired bootstrap resamples (seed 20261021; balanced pair-order seed 1). The complete-suite median is measured directly, rather than calculated by adding query medians.
| Query | MO median ms | DuckDB median ms | MO / DuckDB | 95% paired bootstrap CI |
|---|---|---|---|---|
| Q1 | 2037.968 | 123.841 | 16.46× | 16.27–16.61× |
| Q2 | 85.713 | 29.194 | 2.94× | 2.76–3.10× |
| Q3 | 448.094 | 66.507 | 6.74× | 6.58–7.01× |
| Q4 | 360.414 | 77.656 | 4.64× | 4.47–4.78× |
| Q5 | 394.837 | 70.093 | 5.63× | 5.29–5.79× |
| Q6 | 260.811 | 24.368 | 10.70× | 10.13–11.38× |
| Q7 | 379.635 | 58.027 | 6.54× | 6.45–6.70× |
| Q8 | 386.090 | 64.333 | 6.00× | 5.79–6.05× |
| Q9 | 774.500 | 271.004 | 2.86× | 2.69–2.92× |
| Q10 | 648.379 | 149.139 | 4.35× | 4.15–4.54× |
| Q11 | 111.821 | 18.624 | 6.00× | 5.74–6.25× |
| Q12 | 512.892 | 61.616 | 8.32× | 8.13–8.94× |
| Q13 | 377.553 | 215.288 | 1.75× | 1.71–1.78× |
| Q14 | 269.213 | 47.813 | 5.63× | 5.32–5.85× |
| Q15 | 486.108 | 37.507 | 12.96× | 11.64–13.35× |
| Q16 | 158.618 | 70.786 | 2.24× | 2.19–2.32× |
| Q17 | 353.004 | 72.093 | 4.90× | 4.67–5.26× |
| Q18 | 1150.651 | 205.293 | 5.60× | 5.48–5.69× |
| Q19 | 668.279 | 89.155 | 7.50× | 7.37–7.94× |
| Q20 | 404.687 | 56.766 | 7.13× | 6.58–7.35× |
| Q21 | 1466.519 | 226.620 | 6.47× | 6.30–6.75× |
| Q22 | 111.832 | 54.770 | 2.04× | 1.98–2.11× |
Conclusions and implementation evidence
What explains the remaining gap
The suite gap follows CPU demand. MO uses a median 80.159 CPU-seconds/suite, DuckDB 14.428, a 5.556× difference. Average occupied cores are approximately 6.75 vs 6.85 within the same eight-core envelope. Storage I/O and spilling are absent from these measured windows; execution efficiency and the amount of work performed remain the main targets.
The following are measured observations checked against the exact pinned Go and C++ implementations. CPU shares below are exclusive user-mode sample leaves, so nested callers are not added together. Native operator timers supply plan context and are not treated as process CPU seconds.
-
Q1: decimal casts, wide arithmetic, and grouping specialization. Q1 is 16.46× slower in the scored run. MO's actual plan promotes revenue expressions to Decimal256. Its focused replay spends 11.57% of sampled user CPU in
T.ToType, 4.19% incanWidenDecimalScale, and 2.86% inT.TypeLen: 18.62% combined exclusive leaf weight. Recorded call chains place theToTypehotspot under decimal cast scale checks. The MO cast loops call the same type proof for each row even though source/destination types are fixed for the batch. Hoisting those proofs and representation-width decisions is a concrete first fix that preserves decimal behavior.DuckDB's profile executes integer scalar kernels,
sum_no_overflow, andPERFECT_HASH_GROUP_BY. Its decimal binder chooses physical widths and checked overflow behavior during binding, while SUM statistics propagation proves when 64-bit accumulation is safe. Its perfect aggregate table indexes aggregate states directly from compact group codes. MO instead prepares general string grouping keys;fillStringGroupStralone accounts for 3.63% of Q1 user samples. Precision inference, guarded narrow execution, and small-domain grouping deserve separate work; changing the benchmark SQL or removing overflow checks would change the experiment. -
Q18: high-cardinality grouping and aggregate updates. Q18 is 5.60× slower. Both plans perform grouping over the large order-key domain. In the MO replay,
sumDecimal64FastExec.batchFillaccounts for 23.83%,Int64HashMap.PlanInsertBatch22.77%, andruntime.mapaccess2_fast644.97% of user samples. The MO insertion planner probes existing cells and stages new slots before commit; this preserves admission/publication invariants but is a material CPU cost. DuckDB's leading leaf isGroupedAggregateHashTable::FindOrCreateGroupsInternalat 22.94% of a much smaller CPU total. The measured direction is to reduce grouping preflight/probe work and batch aggregate-update overhead while retaining failure-atomic publication and memory admission. -
Q21 and Q9: hash probing, row materialization, and runtime filters.
Int64HashMap.FindBatchaccounts for 17.98% of MO Q21 and 22.62% of MO Q9 user samples. Q9 additionally spends 8.42% inVector.UnionOneand 4.89% in varlena construction. Q21's plans show different join/filter work: MO's filtered orders scan emits 7,309,184 rows, while DuckDB's dynamically filtered orders scan emits 711,755; both scan the same logical orders table. Q9's DuckDB lineitem scan applies a part-key Bloom filter and emits 3,445,118 rows; MO emits 59,986,052 to its next join. Investigate filter placement/effectiveness alongside narrow-key probes and batched materialization. These are work-volume and kernel-efficiency opportunities, rather than a blanket explanation based on implementation language. -
Q19 and Q10: decoding and string/filter processing remain expensive with resident data. LZ4 decoding accounts for 22.16% of MO Q19 and 24.13% of MO Q10 user samples. Q19 also spends 4.42% in
validateVectorBinaryand 4.30% invalidateJSONPayload. These samples come from MO's production vector decoder. The decoder extracts each varlen payload and calls the JSON helper, whose first action returns for non-JSON types. TPC-H has no JSON columns here. Moving that type decision outside the per-value loop can preserve offset/bounds validation while avoiding unnecessary payload extraction/helper calls.Q19 already filters MO lineitem down to 1,284,344 rows at the scan, versus 14,994,611 at DuckDB's scan, yet MO remains 7.50× slower. That query specifically points to per-row scan/decode/predicate costs. DuckDB's corresponding hot paths are encoded-column
FilterSelection, vector selection, and bit-packed scans. Audit selected-column decoding, decoded-buffer reuse, and string predicate execution at the fixed memory budget. A warm OS cache by itself does not remove any of this CPU work.
Profiling measurements
Common CPU profiling now covers all 22 queries on both engines (44 accepted recordings). The initially selected six queries contribute 58.2% of the summed per-query excess latency. CPU records replay the unchanged query separately after an excluded target-query warmup; counts differ to obtain a useful sampling window and all values below are normalized per query. They are diagnostic measurements, separate from the ten-pair score.
| Query | MO CPU s/query | DuckDB CPU s/query | MO/DuckDB CPU | MO/DuckDB retired instructions |
|---|---|---|---|---|
| Q1 | 13.524 | 0.976 | 13.86× | 17.88× |
| Q2 | 0.238 | 0.109 | 2.18× | 2.10× |
| Q3 | 2.423 | 0.438 | 5.53× | 3.84× |
| Q4 | 2.005 | 0.451 | 4.45× | 3.50× |
| Q5 | 2.447 | 0.476 | 5.14× | 3.58× |
| Q6 | 1.516 | 0.189 | 8.03× | 5.61× |
| Q7 | 2.194 | 0.421 | 5.22× | 3.49× |
| Q8 | 2.193 | 0.426 | 5.15× | 3.01× |
| Q9 | 4.890 | 1.929 | 2.54× | 3.44× |
| Q10 | 4.493 | 0.911 | 4.93× | 6.63× |
| Q11 | 0.409 | 0.074 | 5.50× | 4.76× |
| Q12 | 3.347 | 0.428 | 7.81× | 7.93× |
| Q13 | 2.738 | 1.616 | 1.69× | 2.32× |
| Q14 | 1.487 | 0.332 | 4.48× | 4.76× |
| Q15 | 2.900 | 0.274 | 10.58× | 9.45× |
| Q16 | 0.563 | 0.344 | 1.64× | 2.19× |
| Q17 | 1.978 | 0.506 | 3.91× | 3.61× |
| Q18 | 5.760 | 1.513 | 3.81× | 2.59× |
| Q19 | 4.347 | 0.645 | 6.73× | 8.57× |
| Q20 | 2.374 | 0.388 | 6.12× | 4.34× |
| Q21 | 9.043 | 1.403 | 6.45× | 6.33× |
| Q22 | 0.607 | 0.331 | 1.83× | 3.22× |
All PMU cycle/instruction counters ran at 100% of their enabled interval. Leaf sampling covers approximately 96.5–102.5% of cgroup user CPU; finite sampling and capture-window boundary differences explain the non-exact agreement. Known-symbol leaf coverage is 99.1–100.0% for MO and 83.6–99.7% for DuckDB; unresolved leaf weight is reported per capture in the profile index. No lost sample records were observed. The issue links individual query samples, aggregate resource windows, sanitized exclusive-leaf CPU diagrams/summaries and all native plans. Raw CPU recordings and counter files are now published individually in the full profiling update; unrelated machine/process dumps remain local.
Historical reference and boundaries
The previous SF10 result was MO 15.115910s, DuckDB 2.061878s, ratio 7.331×. The new MO suite is 21.45% shorter and the ratio is 5.639×. The previous warm MO windows still read about 12.2 GiB physically per suite; DuckDB read zero. The exact native executables and logical workload are reused, but the old images were deleted, new statistics/layout were produced during reloading, and the new run uses tmpfs. Consequently this historical delta is a reference, not an isolated causal estimate of removing disk reads. Q1 and Q18 did not improve against the old table, reinforcing the need to use the new profiles rather than infer every cause from the suite delta.
The primary result is an end-to-end application comparison, including MO's services/client and DuckDB's embedded worker. Native storage formats, normal execution operators, original decimal schema, session settings and Q15 view lifecycle remain in use. No separate input-table or reference-result qualification was performed; the legacy worker checks and capture described above did occur. CPU profiles identify specific optimization targets; they do not establish the speedup of any unimplemented fix.
Additional information
Reproduction and preparation
- Generate SF10 once with the pinned generator (
dbgen -s 10 -f). Load both engines using native parallel loaders; run statistics collection and checkpointing outside query timing. - Freeze stopped native images. For every trial, copy the selected image into a fresh owned tmpfs directory using a launcher already inside the application cgroup. Rewrite only configuration paths, then exec the unchanged native binary.
- Complete the excluded warmup, wait at the worker ready barrier, snapshot resource counters and begin monitoring spill-directory creation/modification/deletion events. Release the worker for one full suite.
- At the done barrier snapshot CPU, peak memory, physical reads/writes, swap, pressure and spill events. Archive output after the window, stop owned MO with SIGINT, join processes, and remove the RAM image.
- Run ten balanced paired blocks. Collect native profiles for all 22 queries and common CPU/PMU samples for all 22 queries in separate instrumented replays.
Initial pilots showed why warmup alone was insufficient: MO defaults to small file caches and explicitly advises OS pages away after reads. Increasing the CN cache to 16 GiB still read storage; locking initial files also failed to cover files created/replaced by background work. Those runs are excluded from scoring. The final tmpfs method eliminates reads and writes for both engines and applies the same memory accounting. One interrupted temporal pair was rerun in full when correcting an unnecessarily strict metadata gate that rejected one reclaimed code/cache page despite zero I/O and pressure; no runs were selected by latency.
One-time setup observations, separately timed:
| Preparation stage | MO | DuckDB |
|---|---|---|
| Bulk load | 50.446s | 56.163s |
| Statistics collection | 72.556s | 1.910s |
| Checkpoint | 0.508s | 0.005s |
Shared data generation took 226.496s. These are single preparation observations, not repeated ingestion benchmarks.
Downloadable result data and profiles
All downloads are separate files; profile/data downloads are individually Zstandard-compressed. Release index, per-query CSV, all 440 query timing samples, result/resource summary, all-query CPU/profile index, checksums. Figures are available as PNG and SVG.
| Query | MO native EXPLAIN ANALYZE | DuckDB native operator profile | MO CPU leaves | DuckDB CPU leaves |
|---|---|---|---|---|
| Q1 | EXPLAIN | JSON | SVG | SVG |
| Q2 | EXPLAIN | JSON | SVG | SVG |
| Q3 | EXPLAIN | JSON | SVG | SVG |
| Q4 | EXPLAIN | JSON | SVG | SVG |
| Q5 | EXPLAIN | JSON | SVG | SVG |
| Q6 | EXPLAIN | JSON | SVG | SVG |
| Q7 | EXPLAIN | JSON | SVG | SVG |
| Q8 | EXPLAIN | JSON | SVG | SVG |
| Q9 | EXPLAIN | JSON | SVG | SVG |
| Q10 | EXPLAIN | JSON | SVG | SVG |
| Q11 | EXPLAIN | JSON | SVG | SVG |
| Q12 | EXPLAIN | JSON | SVG | SVG |
| Q13 | EXPLAIN | JSON | SVG | SVG |
| Q14 | EXPLAIN | JSON | SVG | SVG |
| Q15 | EXPLAIN | JSON | SVG | SVG |
| Q16 | EXPLAIN | JSON | SVG | SVG |
| Q17 | EXPLAIN | JSON | SVG | SVG |
| Q18 | EXPLAIN | JSON | SVG | SVG |
| Q19 | EXPLAIN | JSON | SVG | SVG |
| Q20 | EXPLAIN | JSON | SVG | SVG |
| Q21 | EXPLAIN | JSON | SVG | SVG |
| Q22 | EXPLAIN | JSON | SVG | SVG |
Published profiles now include raw CPU recordings and counters plus derived call-stack/leaf diagrams for all queries; full receipts and unrelated host/process dumps remain local. All benchmark-owned services, workers and RAM images have been cleaned up. Unrelated services were not modified by that archived campaign.
Full profiling update
44 accepted CPU recordings and 44 native profiles cover all 22 queries on both engines. The full profiling comment provides individual raw recordings, counter files, diagrams and analysis instructions: #30716 (comment)

Activity
aunjgr commentedon Oct 21, 2026
All-query profiling results and downloadable recordings
Common CPU profiling now covers all 22 SF10 queries on both engines: 44 accepted CPU recordings, alongside 44 native operator profiles. The original ten-pair latency result remains MO 11.873838s vs DuckDB 2.105494s, 5.639×. Profiling uses separate instrumented replays and does not replace or alter those scores.
All 44 accepted CPU windows have zero physical reads/writes, zero spill events and zero swap, under the same eight physical cores and 32 GiB total application limit, with frozen native images staged in RAM. Each capture has an excluded target-query warmup and repeated executions to obtain about four seconds of sampling; metrics below are normalized per query. The query's original SQL, including Q15 view creation/SELECT/removal, is retained.
CPU cost for all 22 queries
Additional findings from the expanded coverage
evalFilter, and 10.72% in the boolean parameter getter. DuckDB's main corresponding work is encoded-columnFilterSelectionSwitchand bit-packed scans. This gives a concrete CPU explanation for the 10.70× latency gap despite zero storage I/O.runtime.mapaccess2_fast32; all 839 recorded call chains containing that lookup lead throughopOperatorFixedIn[int32].operatorIn. The pinned MO implementation performs a Go map lookup for each row. The native plan applies part-key runtime filters to lineitem scans. DuckDB spends 17.18% of its smaller CPU total inBloomFilter::LookupHashes; its pinned C++ implementation processes a flat hash vector with bit-mask probes and emits selection indices. This identifies membership filtering as another optimization target; exact SQL IN semantics and approximate runtime-filter semantics must remain distinct.The earlier source-backed findings remain: Q1 decimal cast/type proofs and grouping specialization; Q18 aggregate updates/insertion planning; Q9/Q21 hash probes, materialization and runtime-filter effectiveness; Q10/Q19 decoding and vector/string handling. The complete recordings now allow independent analysis of every query, including the smaller gaps.
Individual compressed downloads
Complete profile index records repetitions, CPU normalization, PMU values, memory/I/O/spill evidence, sampling quality, and every download URL. Checksums. Files are individually Zstandard-compressed; there is no tarball. The new profile files total 11.28 MiB compressed.
The original issue's per-query table links all MO EXPLAIN ANALYZE texts and DuckDB native operator JSONs. Folded caller stacks and exclusive-leaf data for all 44 CPU recordings are also linked from the profile index.
Reading the recordings
Both engines use Linux perf user-mode
cpu-clocksampling at 99 Hz and user cycles/instructions. Raw files contain instruction addresses and frame-pointer call chains, recorded-task metadata and normal library/hardware headers; they contain no sampled stack-memory or register/raw-data payloads.Exact matching executables/symbols were already published: MO executable and shared query worker with embedded DuckDB. Their SHA-256 identities match the executables used for these captures. After decompressing,
perf buildid-cache -a ./mo-serviceandperf buildid-cache -a ./tpch-compare-agg2gmake their symbols available locally. Matching libraries are indexed in the existing symbol release.Coverage and excluded diagnostics
No lost sample records were observed. Caller-stack completeness depends on the native binary frame-pointer layout, particularly for optimized C++; stack diagrams are context views, and cross-engine CPU comparisons use exclusive leaves and cgroup CPU counters. Native operator timer sums are not substituted for process CPU-seconds.
Two initial diagnostic captures failed the zero-I/O gate and were repeated with the same query/count. The original records are retained as excluded and published separately for transparency; they are not used in the accepted CPU table or the latency benchmark:
No new executable/source uploads, unrelated host/process dumps, full receipts or ordinary SQL result rows are part of this publication. Benchmark services/workers and temporary RAM images have been cleaned up.
aunjgr commentedon Oct 21, 2026
SF100 server129: completed all-memory comparison, 64 logical CPUs, 192 GiB MO cache
The ten-pair score is complete: MO 76.199567 s vs DuckDB 14.811365 s per Q1–Q22 suite, MO/DuckDB 5.144669×, paired-bootstrap 95% CI [5.108797, 5.169426]. All 22 queries are slower in MO. The 440 scored query timings exclude the first, cold suite; every scored arm has its own excluded full-suite warmup.
All 20 scored windows have zero physical reads/writes, zero process block-I/O bytes, zero spills, zero swap, zero major faults and zero OOM deltas. Native database images are in private tmpfs and charged to each engine's memory budget. MO's CN SHARED memory cache is explicitly configured to 192 GiB in TOML. This establishes an all-memory storage comparison; configured capacity does not by itself establish simultaneous residency of every decoded column in MO's internal cache.
This is a separate server129 SF100 experiment. The SF10 workstation results above remain valid under their own hardware, CPU and memory settings; changes between these experiments must not be interpreted as scale-factor-only effects.
Results
Physical I/O, spills and swap are zero for both engines. Memory includes the staged native database image, engine processes/client, caches, workspaces and output buffers/files within the application cgroup. Across the scored windows the largest observed peaks were 132.86 GiB MO and 80.51 GiB DuckDB, below the equal 200 GiB application caps. Approximate busy-CPU utilization is 70.3% MO vs 82.6% DuckDB of the available 64 logical CPUs. CPU cost is therefore higher in MO, while effective parallel utilization is also lower; merely granting more cores does not remove the gap.
The suite statistic is the median of ten complete suite times; it is not the sum of the 22 query medians. Q1, Q18 and Q9 account for 42.2% of the summed per-query median excess latency and are the first optimization targets.
What the profiles establish
Q1: much more arithmetic/type/grouping work per row. Its 16.50× elapsed gap is accompanied by 16.40× more retired user instructions: 2.549 trillion/query in MO vs 155.4 billion/query in DuckDB. IPC is similar (1.645 vs 1.594), so this capture points to excess executed work rather than a broad explanation about implementation language. MO's exclusive user samples include
types.T.ToType11.39%,d256Mul7.69%,canWidenDecimalScale5.53%,sumDecimal64FastExec.batchFill5.40%, LZ4 decoding 7.00%, andruntime.memmove4.44%. The MO native plan contains DECIMAL256 casts/products and generic string-key grouping; DuckDB compresses the grouping keys to tiny integers and usesPERFECT_HASH_GROUP_BY. The next changes to investigate are moving type/scale decisions outside inner loops, range-proven decimal specialization, and compact small-domain group keys. Any narrower arithmetic must preserve SQL decimal semantics; this report does not establish that the current widening can simply be deleted.Q3–Q5: hash probing and decoding.
Int64HashMap.FindBatchalone takes 34.16%, 32.89%, 38.77% of MO's user samples respectively; LZ4 decoding adds 15.55%, 14.86%, 11.67%. MO spends 138.94, 101.22, 161.63 CPU s/query, versus DuckDB 27.91, 23.62, 30.49. Investigate probe layout/locality, vectorized key preparation and effective join/runtime-filter work before assuming scheduler overhead is the main cause. Percentages should be interpreted together with these absolute CPU costs: a smaller fraction of a much larger total can still cost more.Q9: row materialization is a major additional cost. MO spends 387.81 CPU s/query vs 94.61 for DuckDB and retires 5.01× as many instructions. Its leading exclusive leaves include
Int64HashMap.FindBatch18.40%, fixed-widthvector.unionT[int32]17.90%,Vector.UnionOne10.24%, LZ4 5.52% andruntime.memmove4.12%. This supports investigating how many rows/columns joins materialize and whether selected rows can remain in batched/selection form longer. It does not yet quantify the speedup of a proposed change.Warm RAM still leaves decoding, copying and allocation work. For Q6, LZ4 accounts for 21.56%, scan
evalFilter13.63%, andmo_je_je_malloc_mutex_lock_slow9.08% of MO user samples. MO's total CPU is 60.46 s/query vs 8.38. Q7/Q8 LZ4 shares are 21.35%/19.88%; Q10 LZ4 is 17.68% andruntime.memmove7.53%. The relevant next measurements are decoded-buffer reuse, cache admission/hit paths, selected-column decoding, batched copying and allocator contention under this same budget. Eliminating storage I/O does not eliminate these costs.Q18: high-cardinality aggregation and its CPU costs. It groups about 600 million lineitems into 150 million order-key groups before HAVING reduces the output to 6,398 groups. The inner aggregate reports 8.66 GiB aggregate memory. Its 10.97 s elapsed time and 6.40× latency gap make it a priority. The now-published CPU recording measures 383.236 CPU s/query;
sumDecimal64FastExec.batchFillaccounts for 32.61% andInt64HashMap.PlanInsertBatchfor 19.44% of exclusive user-CPU samples. These identify SUM-state updates and group insertion as optimization targets; they do not establish a measured fix speedup. Native operatortimeConsumedaggregates worker work; it must not be presented as query wall time or compared directly with DuckDB's operator timer totals.What the larger MO cache changed
An earlier, separate five-pair 64-CPU run with the default 512 MiB cache measured MO 87.753118 s vs DuckDB 14.696106 s. The new MO median is 13.17% shorter, but this earlier run is a separate campaign and is not included in the ten-pair confidence interval or a randomized cache-only causal estimate.
Metadata-only sizing estimated 115.57 GiB for all query-referenced decoded columns, before extra overhead/hidden columns; 192 GiB is the configured capacity, not preallocated memory or a promise that this much can coexist with the entire database image under the 200 GiB outer cap. An unscored 192 GiB-cache pilot reached about 29.17 GiB cache occupancy with no reported cache-pressure eviction/admission skips. Measured whole-application peaks remained about 133 GiB.
The scored MO suites still report a median 167.08 GiB of logical read activity and 6.05 million read syscalls, while physical read bytes remain zero.
rcharincludes files/pipes/sockets and is not a cache-miss counter or an exact decoded-data total. Together with the CPU samples it motivates tracing the active cache/decode path; it does not prove that a particular bypass branch is active or that adding still more cache capacity will solve the problem. The metadata sizing and unscored cache telemetry are downloadable below.Comparable CPU profiling, separate from latency scoring
CPU profiling uses the same OS-level measurements for Go and C++: 99 Hz user CPU-clock sampling, frame-pointer callchains, and grouped user cycles/instructions. Profiles replay the unchanged query after an excluded warmup, with differing repetition counts to obtain useful samples. All costs below are per completed query, and these instrumented replays are excluded from the score above.
Coverage update: all 44 accepted CPU recordings and 44 native operator profiles, covering Q1–Q22 on both engines, are now published. Captures completed 2026-10-21 14:25:52 UTC; the remaining 23 recordings were added to this release on 2026-10-23. This supersedes the initial 21-recording publication snapshot. No benchmark rerun was needed: these are the completed original campaign recordings. Comprehensive analysis and optimization subtasks.
All published PMU counters ran for 100% of their enabled intervals. Offline symbolication resolves 99.64–100.00% of exclusive leaf weight; no lost sample records were observed. Period-weighted samples represent approximately 92.7–102.2% of measured cgroup user CPU across these captures. Sampling/window differences and build-dependent frame-pointer coverage remain visible in the per-profile index. The SVGs show exclusive user-CPU leaves; raw recordings retain the captured callchains for further analysis.
Environment, provenance and method
GOMAXPROCS=64, DuckDBthreads=64; NUMA interleave across nodes 0–1. The controller shares these CPUs with a separate 2 GiB limit. This is a shared host with quiet-window admission, not an exclusive-host result.[fileservice.cache] memory-capacity = "192GiB"; other MO caches remain 512 MiB. DuckDB internalmemory_limit=160GiBleaves room inside the same outer cap. No memory-limit-hit/OOM/swap deltas were observed. Kernel PSI is unavailable, so no zero-PSI claim is made.873282742714436bff407dfcdbbe879147162bd3; native binary SHA256052a5d906060cfe2e1cb685c717110328cbe3cb0a9df8a62cbf7d28b85ec4fb5. Optimized native CPU build,MO_SIRIUS=0 MO_CL_CUDA=0, GCC-toolset-11, Go 1.27.1,GOAMD64=v3 GOEXPERIMENT=simd; optional jemalloc C++ shim disabled, no optimization-disablinggcflags.GOGC=100,agg_spill_mem=2147483648,save_query_result=off, UTC and ANSI/ONLY_FULL_GROUP_BY.069cc9f9b5be802405797faecc284961b07c70ef; duckdb-go/v2 v2.10506.0 and bindings v0.10506.0. Query worker sourcef881dfc604c11c29067ec5ccfcabbeeb357f40bc, executable SHA25644abb2843de6c097d9cdb227d17d6243c2ad6e88016552963e42de09221f7ca5. The matching ELF contains the embedded C++ symbols.852ad0a5ee31ebefeed884cea4188781dd9613a3. No native engine or query changes were made for this cache rerun. One MO CPU-arm startup bind failure occurred before any query; its failed startup was excluded and only that unmeasured startup was retried. Completed scoring/profile windows were not retried or selected by latency.Results and individual profile downloads
Release / sizes for every download · Results/resource summary · 22-query CSV · All 440 timings · Profile index · Normalized CPU analysis · Cache sizing · Pilot cache telemetry · Checksums · File manifest · Offline analysis instructions
All data/profile/ELF downloads are compressed individually, with no tarball. The release lists each file's compressed and original size. The table gives compressed MiB for raw recordings; PMU CSVs, folded CPU data, exact hashes, call counts and resource windows are linked in the profile index. Both native and CPU profiles now cover every query on both engines.
Exact sampled executables and libraries
These six individually compressed files match the recordings by build ID and SHA256. They enable others to symbolize the Go and embedded C++ code without rebuilding a potentially different binary. Recorded paths and offline
perf --symfsinstructions are in the README/index.The recording sample types were inspected: instruction addresses, frame-pointer callchains and normal task metadata; no sampled stack-memory, register dumps or raw program payload. No ordinary SQL result rows, database/input data, unrelated host/process dumps or source tarballs are published.
[-][Performance]: TPC-H SF10 all-memory comparison — MO vs DuckDB results and CPU profiling[/-][+][Performance]: TPC-H all-memory comparison — MO vs DuckDB SF10/SF100 results and CPU profiling[/+]aunjgr commentedon Nov 3, 2026
New local SF10 round published separately
The 2026-11-03 current-main results and profiles are now recorded in new templated issues:
Both include full results, per-query analyzed profiles and individual compressed raw/counter/native/diagram downloads. Profile release contains all 454 files, including optional matching executable/library archives. MO source is
dd2499cdcdf2722848851d4debca6cd6c66b4751; server129/SF100 remains deferred.This issue's original historical measurements are unchanged; the new profile-only round does not establish a new balanced latency score or attribute all old/new differences to MO changes.
aunjgr commentedon Nov 15, 2026
Closing this completed measurement/reporting issue at the requester's direction.
The scoped SF10/SF100 all-memory comparison, results, conclusions and CPU-profile recordings have been published, including the separately compressed raw recordings and matching executable/symbol references.
The recorded source pins, results, downloads, methodology corrections and uncertainty remain the evidence for that historical round. Completion of this report does not certify current-main performance or close the optimization backlog. Remaining engine optimization work is tracked in #30838 and its subtasks; dictionary execution work remains in #32379.