# database

1 post tagged with "database"

Database Indexes: What Are They and Why Should You Care? (Part 1)

Part 1 starts from what you already knew — that indexes speed up queries — and then digs into the how and the surprises. It covers the full table scan problem with a million-row example, explains indexes through the book analogy, goes under the hood into how B-trees work (20 comparisons vs 1 million), and then hits the big discovery: indexes aren't free, and they can actually slow down your writes. It wraps up with a quick before/after experiment showing a 225x speed improvement. Basically: "I knew the good side, here's how it works, and here's the bad side I didn't expect."

Mar 21, 2026 · 5 min read