OpenGWASDB ukb-b Dense Store — Chunk-Shape Query Benchmark
1000×1000 vs 1000×128 · genome-wide · 2,514 UK Biobank analyses × ~9.85M variants
format_version 0.1, not re-run for the z or eaf encodings
Every figure below was measured against stores whose z plane is
float16 and which carry no eaf at all. Two changes have
landed since, both of which move stored size and add a decode step to every read:
issue #114 (ADR 0037 §1) made z int16 fixed point with an
exact overflow table, and issue #116 (ADR 0037 §2, §4) made eaf a
per-variant baseline plus an int8 logit residual and moved
format_version to 2.0. The sizes and timings here describe neither.
They are re-measured against rebuilt stores in #117, before the version that ships
the encodings is cut (CONTRIBUTING.md, “Benchmarks are measurements,
not prose”).
Overview
Both stores hold the same genome-wide ukb-b data — 2,514 UK Biobank GWAS × ~9.85M variants — and differ only in the zarr chunk shape. The baseline uses square 1000×1000 chunks; the variant keeps the 1,000-variant rows but narrows the analysis axis to 128. An identical query selection (the same ALIDs, analysis ids, and region) is run against each store.
The point of interest is the per-analysis (bulk) read. With a 1,000-analysis-wide chunk, reading one analysis column drags in 999 neighbours per chunk; a 128-wide chunk cuts that waste ~8×. The per-variant (phewas) read moves the other way — it now spans more analysis-chunks — so this is a trade, and the table shows both sides.
This run uses the surgical point-lookup read (issue 052): lookup now fetches only the chunks intersecting the requested rows × columns rather than the full analysis width. That removes the earlier random_lookup penalty on the narrow chunk (previously ~2.4× slower). It was also measured concurrently with a reference-completion job reading the 1000×128 store, so the absolute latencies here are ~10–25% higher than an idle-box run; the queries bulk, phewas, regional, and tophits are unaffected by issue 052, so their differences from the earlier report are load noise, not real change. The load-robust conclusions are the ratios within this run: the bulk speedup and the random_lookup parity.
| Property | Value |
|---|---|
| Analyses (GWAS) | 2,514 |
| Variants (hg38) | 9,847,701 |
| Repetitions (median of) | 7 |
| Baseline chunks | 1000×1000 |
| Variant chunks | 1000×128 |
Query latency: 1000×1000 vs 1000×128
| Query | 1000×1000 | 1000×128 | Change (128 vs 1000) |
|---|---|---|---|
One analysis, all variants (analysis) |
38.76 s | 9.96 s | 3.9× faster |
One variant × all analyses (phewas) |
7.9 ms | 17.9 ms | 2.3× slower |
All associations in a 1 Mb window (range_phewas) |
849.6 ms | 920.5 ms | 1.1× slower |
Genome-wide significant index read (top_hits) |
745.9 ms | 737.4 ms | ≈ same |
100 variants × 10 analyses (lookup) |
913.8 ms | 935.6 ms | ≈ same |
Storage
| Chunk shape | Store size |
|---|---|
| 1000×1000 | 58.0 GB |
| 1000×128 | 54.9 GB |
Chunk shape changes how the same float16 z/se are grouped on disk, so compressed size shifts only modestly; the point of the narrower analysis chunk is read amplification on per-analysis queries, not storage.
Takeaway
bulk(per-analysis) is 3.9× faster on 1000×128 — the chunk-bound read the narrow analysis chunk targets.phewasis 2.3× slower but stays in the millisecond range: one variant row now spans more analysis-chunks.random_lookupis back at parity (936 ms vs 914 ms on 1000×1000). With the surgical column read (issue 052) a scattered point lookup fetches only the chunks it needs, so the narrow chunk no longer penalises it — before 052 it was ~2.4× slower on 1000×128.regionalandtophitsare chunk-insensitive.
With surgical point lookups in place, the narrow analysis chunk is close to a free win for a read-mixed workload: a large speedup on per-analysis reads, phewas still sub-20 ms, and scattered point lookups back at parity. The square chunk only wins if per-variant PheWAS latency is the single priority.
Provenance
- Data:
opengwasdb_chunk_comparison_benchmark.json(frombenchmarks/benchmark_chunk_comparison.py) - 1000x1000:
/local-scratch/data/opengwas/opengwasdb/ukb-b.opengwasdb - 1000x128:
/local-scratch/data/opengwas/opengwasdb/ukb-b-c128.opengwasdb