SQL in your browserStep 1 · Build the database Step 2 · Run the slow query
Step 3 · Add an index Solved
1 Million Row Challenge.
Build a real Postgres database in this tab, run a slow query against a million rows, then pick the index that fixes it. Every number you see is measured on your device, live.
1,000,000 orders, in your browser
Real Postgres, running on your device. One table, orders, with a power user (#4242) who has placed about a thousand of them.
Starting Postgres…
User #4242 opens their orders page
SELECT * FROM orders
WHERE user_id = 4242
ORDER BY created_at DESC
LIMIT 20;Time
Rows read
Show the 20 rows
Show the query plan
Which index makes it fast?
Pick one. It runs for real on your 1,000,000 rows. Each index is tested on its own: the previous one is dropped first.
BeforeWith this index
Time
Rows read
Index size · buildnone
Show the query plan
Your attempts
| Index on | Time | Rows read | Speedup |
|---|
faster
This is Module 1 of Vyson. You profile real queries on real data, fix them, and a senior engineer reviews every submission.