Database

What is Database Index?

A data structure, typically a B-tree, that lets the database find rows matching a query without scanning the entire table.

Definition

An index is an auxiliary structure — most commonly a B-tree, sometimes a hash, GiST, or inverted index — that maps column values to row locations so the database can satisfy WHERE clauses and ORDER BY without a full table scan. A lookup that scanned ten million rows becomes a handful of page reads. Indexes aren't free: every INSERT and UPDATE must maintain them, and they consume disk and cache. Composite indexes must match query column order to be usable, and EXPLAIN output reveals whether the planner actually uses one. Indexing strategy is the highest-leverage database tuning skill.

Related Terms

Keep the references coming

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.