How database indexes work
You'll understand that a database index is a data structure that maps column values to row locations, enabling the database to find data without scanning every row.
You'll see how indexes reduce the number of rows examined during a query, turning full table scans into targeted lookups that complete in milliseconds instead of seconds.
You'll learn how B-trees organize index data in a balanced tree that keeps search depth logarithmic, and why the database automatically maintains this balance as data changes.
You'll recognize that indexes speed up reads but slow down writes, and understand how cardinality and selectivity help the query optimizer decide when an index is worth the cost.