Skip to content

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.

NHyperMesh median (µs)PostgreSQL median (µs)Speedup
10K~80~520
100K~95~1,40015×
1M~110~4,50041×

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.

Terminal window
# With Docker (fully isolated, reproducible)
docker-compose -f docker-compose.benchmark.yml up -d pg
sleep 5
docker-compose -f docker-compose.benchmark.yml run --rm benchmark
# Without Docker (local Python + psycopg2)
pip install psycopg2-binary
HMDB_BENCH_PG_DSN="postgresql://user:pass@localhost:5433/hmdb_bench" \
python benchmarks/compare_pg.py

Results are written to benchmarks/results/pg_comparison.{csv,txt}.

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)