ClickHouse vs Postgres: A 100 Million Row Showdown on a Mac Mini
A Mac Mini M4 benchmark pits ClickHouse against Postgres across 100 million LLM trace rows, comparing ingest speed, disk usage, and query latency.
An engineer ran a hands-on benchmark to test whether Langfuse's move from Postgres to ClickHouse for LLM trace storage was actually justified. Using a single Mac Mini M4 Pro, identical synthetic LLM trace data — scaling from 1 million to 100 million rows — was loaded into both databases and hit with the same three representative queries: a point lookup, a dashboard aggregation, and a metrics rollup.
The results confirm a classic OLTP-vs-OLAP split rather than a clean winner. ClickHouse ingested at a flat ~78K rows/sec and compressed 100 million rows into 48 GB versus Postgres's 116 GB, while Postgres's ingest rate degraded from 32K to 14K rows/sec as its indexes grew. Postgres crushed single-row lookups (~0.03ms vs ClickHouse's ~3ms), but on the dashboard query at 100M rows, Postgres took ~49 seconds versus ClickHouse's 284 milliseconds — and the metrics query gap was even starker.
For engineers, the takeaway is workload-dependent: Postgres remains the right choice for point-lookup-heavy systems, but observability-style dashboards running analytical aggregations over tens of millions of rows genuinely need a columnar store like ClickHouse — the Langfuse migration wasn't hype. Notably, a consumer Mac Mini with 24GB RAM handled the full 100 million rows on both databases without issue.