Module 0 · Orientation

Episode 1 The Life of a Query

10 min · SQL · Postgres

Title card of Episode 1: The Life of a Query

▶ This video is coming to YouTube soon.

One SELECT walks through every part of Postgres: the parser and parse analysis, the rewriter and views, the planner's cost estimates, the executor's pull-based operators, the buffer pool and the disk. Every stage is checked on a real Postgres with EXPLAIN, pg_rewrite and pg_buffercache, and each box points to the episodes that open it up.

Chapters

  1. 0:00Intro
  2. 0:14One line of SQL, eight modules
  3. 0:36The map: one query, every module
  4. 2:04Parse: from text to a tree
  5. 2:55Rewrite: a view is a stored query
  6. 3:28Plan: estimate everything, run nothing
  7. 4:18Execute: rows are pulled up the plan
  8. 5:21The code: one call runs every plan
  9. 5:57Pages: the buffer pool, then the disk
  10. 6:53Proof: parser, rewriter, planner
  11. 8:01Proof: executor, buffer pool, disk
  12. 8:41The season, box by box
  13. 9:12Recap
  14. 9:39Next: The Memory Hierarchy