Learning paths · Skills · Intermediate

SQL and PostgreSQL: what the database really does

What happens between sending a query and getting rows back: the planner and its plans, the indexes it can use, the transactions and row versions that let many writers share a table, and what changes when you add a pooler, replicas and partitions.

0 of 13 done

The map

  • Not started
  • In progress
  • Done
  1. 01How a query runsPlans, indexes and joins0/4
  2. 02Shaping the dataConstraints, tables and pages0/3
  3. 03Many writers at onceIsolation, row versions, locks0/3
  4. 04Running it for realConnections, replicas, partitions0/3
  5. 05Next: system designSame ideas, at service scale

Written for PostgreSQL 16 and 17; the links point to the version 17 manual. The examples were run on a scratch database (orders, customers and accounts tables with a few hundred thousand rows). Costs and timings in the plans will differ on your machine, but the plan shapes are what matter.

Where this path leads