OpenGWASDB ukb-b Dense Store — format 3.0 performance

Residual-coded standard errors · 24.7 billion cells

Published

September 8, 2026

NoteFinal performance summary

Format 3.0 reduces the complete Store Release from 59.50 GB to 42.56 GB (−28.5%) and its se representation from 21.18 GB to 3.96 GB (−81.3%). The cost is a 16.5% longer build and a mixed query-latency result: whole-Analysis reads improve by 12.1%, while the cached all-Analysis regional scan takes 2.25× as long because residual se reconstruction is compute-bound. Crucially, the same region restricted to one Analysis changes only +4.8% (22.75 → 23.85 ms). The two requested random-lookup shapes also remain close to their baselines at −3.1% and +7.8%.

The performance case supports the format change provided that the all-Analysis regional trade-off is accepted: it exchanges one known decode-bound regression for a large storage reduction and faster IO-bound scans. Narrow regional and random lookup shapes remain stable. Correctness checks passed: all compared query result counts match, and the MR IVW result agrees to three decimal places.

Benchmark scope

Query timings re-measured on 2026-09-08 against two Observed-Only Dense ukb-b Store Releases built from the same 2,511 GWAS-VCF sources by the same generator. Each contains 9,847,701 variants × 2,511 Analyses = 24,727,577,211 cells. Query figures are medians of five warmed repetitions on an otherwise idle machine.

The releases hold z and eaf encoding constant and change se only:

Property Format 2.0 Format 3.0
Store format 2.0 3.0
z int16_fixed, scale 1024 int16_fixed, scale 1024
se float16 int8_residual ±0.5
eaf int8_residual ±0.5 int8_residual ±0.5
Variants 9,847,701 9,847,701
Analyses 2,511 2,511

Storage

Measure Format 2.0 Format 3.0 Change
Complete Store Release 59.50 GB 42.56 GB -28.5%
data.zarr payload 58.60 GB 41.66 GB −28.9%
se codes + side tables + coefficients 21.18 GB 3.96 GB −81.3%
Bytes per cell for se 0.857 0.160 −81.3%
Compression against source GWAS-VCFs 7.14× 9.98×

The residual representation has 3,957,471,004 bytes of codes, 3,786,980 bytes of exception side tables, and 16,248 bytes of coefficients. Only 1,677,442 of 24,727,577,211 cells (0.0068%) fall outside ±0.5, against the 2% exception budget. The shared study design therefore makes the residuals highly compressible: the se saving exceeds both ADR 0037 §3’s predicted 58.1% and the 59.0% measured on the FinnGen R13 pilot.

The complete Store Release figures above include the indexes and metadata outside data.zarr. This distinction matters: the format-3 top-hit index is larger, so the 81.3% reduction in se becomes a 28.5% reduction in the whole release. At format 3.0, z is the dominant array (31.53 GB).

Build performance

Measure Format 2.0 Format 3.0 Change
Build time 11.59 h 13.50 h +16.5%
Wall time 41,714 s 48,603 s

The additional 1 h 55 min pays for the per-Analysis fit, candidate measurement, exact codes-only exception count, and rewrite passes used by the format-3 Dense builder.

Query performance

Query Result cells Format 2.0 Format 3.0 Change
Whole Analysis 8,419,893 29.06 s 25.54 s -12.1%
Regional (1 Mb × all Analyses) 5,224,822 786.83 ms 1.77 s +125.4%
Regional (1 Mb × one Analysis) 3,197 22.75 ms 23.85 ms +4.8%
PheWAS 1,341 6.56 ms 5.92 ms -9.7%
Random lookup (10 variants × 100 Analyses) 637 79.42 ms 85.65 ms +7.8%
Random lookup (100 variants × 10 Analyses) 517 675.59 ms 654.35 ms -3.1%

Latency moves in both directions because physical chunks touched, cache locality, and result width determine whether decode or IO dominates:

  • A direct 52,253,910-cell band read through DenseSePlane measured 0.0050 µs/cell for float16 and 0.0700 µs/cell for int8_residual — a 14× decode cost. Residual reconstruction decodes eaf and evaluates an exponential for each cell. This dominates the warmed all-Analysis regional scan and explains its 787 ms → 1.77 s regression.
  • Restricting the same region to ukb-b-10912 through the public lookup operation reads only one Analysis. It returns 3,197 cells in 22.75 ms at format 2.0 and 23.85 ms at format 3.0 (+4.8%). The residual decode is no longer multiplied across all 2,511 Analyses. range_phewas has no Analysis-filter argument, so the benchmark resolves the region’s ALIDs once and times lookup(alids, [analysis_id]), including its normal identifier resolution and chunk reads.
  • The whole-Analysis query is IO-bound. Its 5.3× smaller se representation more than offsets reconstruction, improving 29.06 s → 25.54 s.
  • PheWAS remains a low-millisecond point query at 6.56 → 5.92 ms. Random lookup changes from 79.42 → 85.65 ms for 10 variants × 100 Analyses (+7.8%) and 675.59 → 654.35 ms for 100 variants × 10 Analyses (−3.1%). These small, opposite movements show that scattered row-chunk access matters more than requested cell count and are not distinguished confidently from host variance by five repetitions.

Top hits are not an encoding comparison

Per-Analysis top hits measured 78.97 ms in the format-2 release and 1.36 ms in the format-3 release, with 7,390 results in both. That apparent 58× improvement is not attributed to residual se: the format-2 release predates issues #131–#134 and its top-hit tier lacks indexed eaf, so it takes the known pre-fix path. The benchmark’s independent pre-EAF baseline is 1.17 ms. Top-hit latency is therefore excluded from the comparison table and acceptance summary.

Scientific and result validation

Check Result
Compared query result counts all match
MR instruments 66 → 66
MR IVW beta 0.115089 → 0.115020
MR IVW standard error 0.005386 → 0.005383
MR IVW p-value 2.60e-101 → 2.79e-101

The IVW estimate agrees to three decimal places (0.115), providing an end-to-end smoke test that the encoding change preserves the scientific result for this analysis. This is a query-layer validation, not a definitive Mendelian-randomization result.

Acceptance assessment

The measurements show a clear, quantified trade-off rather than a uniform speedup:

  1. Storage goal achieved: se is 81.3% smaller and the complete Store Release is 28.5% smaller.
  2. Large IO-bound access improved: a whole Analysis is 12.1% faster.
  3. Narrow access remains stable: one-Analysis regional lookup is 23.85 ms (+4.8%); PheWAS is 5.92 ms; and the two random lookup shapes move by −3.1% and +7.8% in opposite directions.
  4. Known cost is specific to wide reads: cached all-Analysis regional access takes 2.25× as long due to the measured residual decode cost, not unexplained IO or a result mismatch.
  5. Correctness signal: compared result counts match and the MR IVW estimate is stable.

On performance evidence alone, the PR is reasonable to accept if the project accepts the all-Analysis regional-query regression in exchange for the storage and whole-Analysis gains. The newly requested one-Analysis regional query does not share that regression. If wide regional scans are latency-critical, the 1.77 s median is the remaining optimization target; it should not be hidden by the large storage win.

Provenance and limitations

  • Raw benchmark outputs: opengwasdb_ukbb_dense_issue148_se2_benchmark.json and opengwasdb_ukbb_dense_issue148_se3_benchmark.json.
  • Benchmark driver: benchmarks/benchmark_ukbb_dense.py.
  • Source release generator: opengwasdb-stores/families/ukb-b/releases/dense-observed-vcf-c128-rebuild117.
  • Five warmed repetitions characterize steady-state latency, not cold-cache latency or host-to-host variability.
  • ADR 0037 §3’s old query timings came from a stale top-hit index and its storage estimate is contradicted by this full-scale measurement; those figures should be re-run before being used independently.