How Database Indexes Work: B-Trees, Intuitively
Database indexes aren’t magic — they’re B-trees: wide, shallow, self-balancing structures that turn million-row scans into about three page reads. This explainer builds the intuition, walks through real engine behavior in PostgreSQL and MySQL, and spells out the write costs indexes carry.