Database Indexing Explained: How B-Trees Make SQL Fast
Saurabh at Scale
0:00 / 0:00
Database Indexing Explained: How B-Trees Make SQL Fast
9 просмотров · 1 дн. назад
Saurabh at Scale
37 подписчиков
9 просмотров · 1 дн. назад
Database indexing explained for beginners, step by step, with no jargon. See how a database index and a B-tree turn a slow full table scan into a 3-read lookup. This applies to MySQL, PostgreSQL, SQL Server and most relational databases.
If you've wondered "why is my SQL query slow?" or "how do database indexes work?", this whiteboard explainer is for you. It's also good prep for system design and backend interviews.
In this video:
• What a database index is (the phone book analogy)
• Full table scans and why disk reads are slow
• Sorted data, binary search and the problem with plain trees
• What a B-tree index is and how a lookup works
• Range queries, composite indexes and column order
• The hidden cost of indexes, and when the database ignores yours
⏱ CHAPTERS
00:00 Why is this SQL query slow?
00:17 What you'll learn about database indexing
00:30 The phone book problem
00:56 Tables, rows and columns
01:23 What is a full table scan?
01:50 Why disk reads make scans slow
02:16 What is a database index?
02:42 Sorted data and binary search
03:21 The catch with sorted data
03:45 Tree indexes
04:14 What is a B-tree index?
04:52 How a B-tree lookup works
05:20 Index pointers to table rows
05:46 Range queries with indexes
06:14 The cost of indexes
06:42 Composite indexes and column order
07:15 When the database ignores your index
07:51 Recap
08:17 What to learn next
🔔 Subscribe to @saurabhatscale for more system design and database concepts explained visually.
💬 Which concept should I explain next? Tell me in the comments.
#DatabaseIndexing #SQL #BTree #SystemDesign #Databases