Back to Browse

How SQL Indexes Actually Work (Step-by-Step)

33.5K views
Dec 30, 2025
16:07

Get the source code for this video for FREE → https://the-dotnet-weekly.ck.page/indexing Want to master Clean Architecture? Go here: https://bit.ly/3PupkOJ Want to unlock Modular Monoliths? Go here: https://bit.ly/3SXlzSt Most developers know that indexes make queries faster, but few understand why or how to design them properly. In this video, we pull back the curtain on SQL Indexing using PostgreSQL to show you how to transform slow, sluggish queries into high-performance operations. We’ll walk through a real-world scenario—optimizing a comments system—and demonstrate how a few strategic changes can take a query from 21ms down to 0.02ms. What You’ll Learn: - B-Tree Internals: How PostgreSQL actually stores and searches index data. - Composite Indexes: Why the order of your columns is the most important decision you'll make. - EXPLAIN ANALYZE: How to read execution plans to find bottlenecks. - Index Scan vs. Index Only Scan: Why SELECT * might be slowing you down more than you think. - The "Left-to-Right" Rule: Understanding how multi-column indexes are filtered. This video is heavily inspired by: "PostgreSQL Indexing : How, why, and when." (https://youtu.be/clrtT_4WBAw) Check out my courses: https://www.milanjovanovic.tech/courses Read my Blog here: https://www.milanjovanovic.tech/blog Join my weekly .NET newsletter: https://www.milanjovanovic.tech Chapters

Download

1 formats

Video Formats

360pmp428.1 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

How SQL Indexes Actually Work (Step-by-Step) | NatokHD