Indexing

Parent: Software Engineering · Published reference · snapshot 2026-08-31

↓ Facts as markdownall context files

An index is a data structure the database keeps sorted so it can find and order documents or rows without scanning the whole collection or table, at the cost of extra writes and storage. Compiled from 9 sources (MongoDB manual and docs, Prisma, Drizzle, Nile/Postgres, Turso/SQLite, Convex, InstantDB, MotherDuck): index types (B-tree, hash, GIN/GiST/SP-GiST/BRIN/bloom, compound, unique, partial, multikey, wildcard, text, geospatial, TTL, hidden, HNSW/IVFFlat), how the query planner chooses and uses an index (explain plans, IXSCAN vs COLLSCAN, covered queries, selectivity, the ESR guideline, hints), how ORMs declare indexes (@@index, index()/uniqueIndex(), .index()/withIndex), and the failure modes (unused or redundant indexes, write overhead, in-memory sorts, full scans).

These notes link each claim to its source. A source may be a research report hosted on this site rather than the primary document. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.

Definitions

Structure and components

How it works

Parameters and configuration

How-to and procedures

Examples and snippets

Measurements and reference values

Problems, failure modes and limitations

Comparisons and alternatives

Changes and history

Facts and statements

Related concepts

Children

← the whole tree · 3D view· how to read this page