Engineer Atlas
OverviewLearnInternalsModeling LabPlaygroundDatabase FinderRoadmapPracticeInterview
OverviewLearnInternalsModeling LabPlaygroundDatabase FinderRoadmapPracticeInterviewCheat SheetCompare
Database Engineering
  • Database Fundamentals
  • SQL
  • Relational Modeling
  • Normalization & Denormalization
  • Indexes
  • Query Execution & Optimization
  • Transactions
  • Concurrency & Isolation
  • PostgreSQL
  • Redis
  • NoSQL & Data Models
  • Vector Databases & Retrieval
  • Scaling
  • Distributed Databases
  • Caching
Database Internals
  • Overview
  • Build AtlasDB
  • Storage, Records & Pages
  • Index Internals
  • Buffer Management
  • WAL & Recovery
  • Transactions & MVCC Internals
  • LSM Trees
  • Query Engine
  • PostgreSQL & InnoDB Internals
  • Distributed Internals
  • Performance Internals
Database/Learn/Indexes
Database Engineering

Indexes

B-trees, hash, composite, partial, covering, expression, full-text — what each can answer, and what an index costs.

See how this works internally:Index Internals →
Why Is This Query Slow? Indexes
▶ interactive

Without an index the engine reads every row to find one; a B-tree finds it in a handful of page reads that barely grow with the table — and the price is storage, slower writes, and a planner that has to decide whether to use it.

Composite Indexes and the Leftmost-Prefix Rule
▶ interactive

A multi-column B-tree is sorted by its first column, then its second inside that, then its third; a query can use it from the left, through equalities, up to the first range — and not at all if it skips the first column.

Index Types: B-tree, Hash, Partial, Expression, Covering, Full-Text
▶ interactive

B-tree answers almost everything; the other types exist for specific shapes — equality-only, a rare subset, a transformed value, text search, similarity — and each is wrong outside its shape.

Should I Add an Index?
▶ interactive

Six questions decide it — frequency, how the column is used, selectivity, table size, write rate, and what already exists — and any one of them can end the conversation with "no".

Engineer Atlas
GitHub·LinkedIn