The missing index

  • Fix
  • Store 02

Difficulty 1 of 5

At 0:20, a new filter starts 500 reads/s over one million rows. Each read scans the whole table. Keep p99 below 50 ms.

0:20. Database CPU jumps. Graph: rows read per filter query rise to the full 1 million rows.

Play level

SQLUsers0 req/sPostgres1 vCPU · 2 GB
SQLUsers0 req/sPostgres1 vCPU · 2 GB
The board at the start of the level
An index against a full scanTap to add or remove the index

Index · 4 pages read per query · disk writes per insert: 2

Goals and limits

p99 latency
under 50 ms
Monthly cost
under 50 USD/mo
Parts you can add
Postgres
Part limit
16
Edit limit
3

Concepts

How players did

Player results load from the server.