WW warin.me

DATA SYSTEMS · INTERACTIVE LAB

Run one logical aggregation across three engines and inspect the physical trade-offs.

The useful question is not “which database wins?” It is “what work did the system avoid, defer, store or repeat?”

Checking isolated teaching runtimes…
ROWS10K
100K
1M
one deterministic sales model

START WITH ONE QUESTION

What can these timings tell us—and what can they not tell us?

Recommended sequence

  1. Choose 100,000 rows so all three engines answer the same bounded analytical question at the same logical scale.
  2. Run all three once as a warm-up; run again and record the second observation. Cache and startup effects can otherwise dominate.
  3. Verify result-row counts and logical equivalence before looking at milliseconds. A fast wrong or different answer is not a comparison.
  4. Compare computation location, physical reuse, rows scanned and bytes read. Mark any metric that an engine cannot report as unavailable—not zero.
  5. Use latency only as a clue. A defensible performance claim requires repeated runs, controlled cache state, equivalent clients and equivalent storage conditions.
What this runtime actually demonstrates

The values are not a product ranking. PostgreSQL reuses a PDO connection; DuckDB includes process startup; ClickHouse uses HTTP and engine-reported elapsed time. Cache, layout and 10K–1M data scale also influence the result.

Read the timing carefully

The displayed value is observed lab latency, not a universal database benchmark. PostgreSQL reuses an open PDO connection; DuckDB starts a subprocess for each request; ClickHouse communicates over HTTP and reports its own engine elapsed time. At only 10K–1M rows, much of the dataset may also remain in cache. Compare query plans, rows and bytes read, freshness and maintenance cost before comparing milliseconds.

CONCEPT

Measure without inventing a universal winner.

The labs use the same logical columns and deterministic formulas, but storage formats, caching and physical layout remain different. Treat timings as observations of this host, not a product ranking.

inserted blockMergeTree pipelineaggregate states

FAIR COMPARISON

Whitelist only · 25 s timeout · 2 CPU / 2 GB ClickHouse ceiling · one operation at a time

execution time
rows scanned
bytes read
rows returned

SQL

Select a bounded experiment.

Result

No result yet.

Explain / query plan

The physical plan appears after execution.
What happened?

Run an experiment, then connect the measurement to physical work.