Skip to content

Database index

A database index supports suitable lookups. It does not accelerate every query and adds storage and data-change overhead.

Also known asIndex
Data platforms

A database index is an additional data structure that helps a database find suitable records more directly. Whether it helps a query depends on factors including search conditions, data distribution and the chosen execution plan.

Example and cost

A hypothetical portal frequently searches by order number. A suitable index can support that lookup instead of scanning all orders each time. This does not imply that every view becomes faster.

The index needs storage and must be maintained when relevant data changes. Additional indexes therefore need evaluation against the actual workload. An ordinary index does not guarantee unique values either; that requires an appropriate uniqueness rule.

Sources