IT lexicon › Database › Multi-Attribute Index

Multi-Attribute Index

Database På svenska → Updated: 2026-11-11

An index on two or more columns that speeds up queries filtering or sorting on multiple attributes simultaneously.

Instead of creating separate indexes on each column, a database can create an index on the combination (name, birth_year) to efficiently answer queries like "find all people with name='Alice' and birth_year=1975". B-tree indexes can be organized so values are sorted on the first attribute first, then on the second attribute within each first-attribute value.

The order of attributes in the index is critical — an index on (name, birth_year) is useful for queries on name but not for queries on birth_year alone (unless it's a prefix of a range query). The query optimizer must choose which indexes best match each query, which is one of the hardest parts of query optimization. Early query optimizers often struggled with this choice.

← Back to the lexicon