Module 3 · Query execution
Episode 19 Processing Models
▶ This video is coming to YouTube soon.
Why does LIMIT 10 touch only 2 of 651 pages? This episode runs one small plan three ways (the iterator / Volcano model, materialization and vectorized execution), counts the calls and memory each one costs, shows why sorts and hash tables break the pipeline, and checks it all with EXPLAIN ANALYZE in Postgres.
Chapters
- 0:00Intro
- 0:15Ten rows, two pages
- 0:35A plan is a tree of operators
- 1:22Iterator: one row per next()
- 2:52The code: every operator is an iterator
- 3:19The code: Limit just stops asking
- 3:43Materialization: finish, then hand up
- 4:29Vectorized: a batch per call
- 5:18What each model pays
- 6:06Pipeline breakers: Sort must read everything
- 7:24Proof: Postgres pulls
- 8:02Proof: the operators that can't wait
- 8:31Trade-offs
- 9:07Recap
- 9:34Next: Access Paths