We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
I Tried to Query 10 MILLION Rows in Postgres in 1 Second
Summary
Description
📝 Get my free SQL Cheat Sheets: https://databasestar.mykajabi.com/lpkj-sql-cheat-sheets/?video=9F4nCjnV43E
🎓 Write faster SQL today: https://databasestar.mykajabi.com/get-write-faster-sql/?video=9F4nCjnV43E
I've got an SQL query that queries a table with more than 10m rows in a table. It runs pretty slowly, and in this video I'll try a range of techniques to get it to run in under 1 second.
⏱ TIMESTAMPS:
00:00 - Our data
01:58 - Our query
04:05 - Add indexes
05:22 - Union All
06:28 - Case
09:17 - Add a column
11:34 - Another index
🔗 VIDEO LINKS:
Scripts shown in this video: https://github.com/bbrumm/databasestar/tree/main/videos/190_10m_postgres
Translated At: 2025-06-29T04:16:39Z