Перейти к содержимому

Why Your Database Is Slow Without an Index

Aniruddha Mahamuni

0:00 / 0:00

Why Your Database Is Slow Without an Index

1 просмотр · 9 дней назад
Aniruddha Mahamuni
5 подписчиков
1 просмотр · 9 дней назад
Database Indexes Explained with PostgreSQL Most developers know that indexes make queries faster, but how do they actually work internally? In this video, we'll go beyond the usual explanation and understand how PostgreSQL stores data on disk, how pages work, and how B-Tree indexes help the database locate rows without scanning the entire table. You'll learn: ✅ How database rows are stored in pages ✅ PostgreSQL page size (8 KB) ✅ How many rows fit in a page ✅ How many pages are required for 1 million users ✅ Sequential Scan vs Index Scan ✅ B-Tree Index Structure ✅ Leaf Nodes and Pointers (TIDs) ✅ Why indexes are much smaller than tables ✅ Why indexes are often cached in memory ✅ PostgreSQL EXPLAIN ANALYZE Demo Example Covered: Users Table id name email password We'll calculate: Approximate row size Rows per page Total pages for 1 million users How PostgreSQL uses an index to jump directly to the correct page Key Takeaway: An index does not store the actual row. An index stores the location of the row, allowing PostgreSQL to avoid scanning thousands of pages and find data much faster. 📺 Related Videos: 👉 How Much Space Your Database Really Uses -    • How Much Space Your Database Really Uses (...   🔥 Subscribe for more “How Systems Work” videos:    / @aniruddhamahamuni   #postgresql #database #indexes #btree #systemdesign #backend #softwareengineering