Row store vs column store

A row store keeps each row together, so a sum over 2 columns still reads every column of every row. A column store reads only the 2 columns it needs. For a dashboard over 200 million rows, the replica takes about 60 s and the column store about 0.6 s.

Play the level

A disk that fillsArrow keys change the write rate. Tap to ship the logs.

5 MB/s · logs kept on the host · disk full in 33 minutes

Each worker adds one network cardDrag or use arrow keys to change the workers

2 workers · 1 TB moves in 1.1 h · 1,000 Mbps per card

Case 1

The shop database answers 4,000 queries/s. A dashboard runs 5 queries/s, and each sums 2 columns over 200 million rows. Dashboard p99 must stay under 2 s.

Case 1
Measure Goal Read replica (rows) Column store
p99 latency (Shop) under 50 ms 3.4 ms Pass 3.4 ms Pass
p99 latency (Dash) under 2 s 60.4 s Fail 560 ms Pass
Error rate (Dash) under 1% 50.7% Fail 0% Pass
Monthly cost 64 USD/mo 64 USD/mo
SQLSQLUsersUsersPostgres8 vCPU · 8 GBPostgres8 vCPU · 8 GB
SQLSQLUsersUsersPostgresPostgres
Read replica (rows): misses a goal
SQLHTTP/2UsersUsersPostgres8 vCPU · 8 GBAnalytics DB1 vCPU · 1 GB × 8
SQLHTTP/2UsersUsersPostgresAnalytics…
Column store: meets the goals