Benchmarks
HyperMesh DB’s TPI Bucket Pushdown achieves 6–40× lower query latency than
PostgreSQL 15 (B-tree index on event_ts) across dataset sizes from 10K to 1M records.
Results summary
Section titled “Results summary”| N | HyperMesh median (µs) | PostgreSQL median (µs) | Speedup |
|---|---|---|---|
| 10K | ~80 | ~520 | 6× |
| 100K | ~95 | ~1,400 | 15× |
| 1M | ~110 | ~4,500 | 41× |
Why the speedup grows with N
Section titled “Why the speedup grows with N”The key insight: PostgreSQL’s B-tree scan must traverse index pages proportional to the number of matching rows — O(k log N) where k is the result set size.
HyperMesh’s TPI Bucket Pushdown computes the first and last relevant bucket via a
single integer division, then calls pread() to read only those physical file segments.
The cost is O(B_window) where B_window is the number of buckets that overlap the
query window — a constant for fixed window / timeline ratio.
As N grows, k grows proportionally, making the PostgreSQL cost scale with N. HyperMesh’s cost stays flat.
How to reproduce
Section titled “How to reproduce”# With Docker (fully isolated, reproducible)docker-compose -f docker-compose.benchmark.yml up -d pgsleep 5docker-compose -f docker-compose.benchmark.yml run --rm benchmark
# Without Docker (local Python + psycopg2)pip install psycopg2-binaryHMDB_BENCH_PG_DSN="postgresql://user:pass@localhost:5433/hmdb_bench" \ python benchmarks/compare_pg.pyResults are written to benchmarks/results/pg_comparison.{csv,txt}.
Full methodology
Section titled “Full methodology”See benchmarks/METHODOLOGY.md
for complete details including:
- Dataset generation methodology
- PostgreSQL configuration (shared_buffers, fsync=off, tmpfs)
- Timing measurement approach
- Limitations and future work (Neo4j, TimescaleDB, write throughput)