Data & storage · Intermediate · 10 min

Indexes

See how an index avoids unnecessary reads and why it still has a write cost.

STEP 1 / 11
Observe a table scan — isometric concept diagramA small result set does not imply a cheap query. Components: 1. Application. Logical component or processing boundary; 2. Table pages. Durable or explicitly scoped state. Connections: 1. Application to Table pages: Observe a table scan; 2. Table pages to Application: Reply: Table pages. Illustrations are conceptual, not deployed capacity or user counts.Application → Table pages: Observe a table scan1Table pages → Application: Reply: Table pages2Application: Logical component or processing boundary1ApplicationLogical component or processingboundaryTable pages: Durable or explicitly scoped state2Table pagesDurable or explicitly scoped state
1Application2Table pages
  1. 1Application → Table pagesRequestObserve a table scan
  2. 2Table pages → ApplicationReplyReply: Table pages

Conceptual illustration · figures do not imply user counts, deployed capacity or replica counts.

2 components visible · Application + Table pages highlighted

Orange: request / query · Blue: reply · Purple: event / control · Arrows show direction; speed is illustrative.

You’ll learn

  • Contrast a full scan with a selective index lookup.
  • Match an index to a query shape.
  • Account for maintenance and storage costs.

PUT THE IDEA TO WORK

From learning to practice

RELATED PATTERNS

Explore architecture patterns ↗

Further reading

PostgreSQL · Indexes ↗