Glossary

Database index

A database index is a secondary structure that lets the database find rows matching a condition without examining every row — the same service a book's index performs for its pages.

It is the difference between a query that answers in a millisecond and the same query taking thirty seconds once the table is large. Almost every "the application got slow as we grew" problem is a missing index on a column that is filtered or joined constantly.

Indexes are not free: each one consumes storage and makes writes slightly slower, because it too must be updated. The practical approach is to add them in response to measured slow queries rather than in anticipation of every possible one.

← Back to the glossary