PostgreSQL Executor: Executing your execution plan
summary
PostgreSQL execution splits into three clear phases — preparatory, execution, cleanup — starting at exec_simple_query and building a per-query QueryDesc and EState with a per-query memory context. Execution repeatedly calls ExecProcNode which dispatches node handlers (ExecScan, ExecHashJoin, ExecInsert) and uses tuple slots and expression states; parallel queries spawn workers that share a dynamic shared memory segment and a tle Q reader (example uses two workers), then master gathers results and shuts down.
AI-written summary · about
chapters (11)
- 0:00Introduction and agenda
- 1:47PostgreSQL query pipeline
- 2:46Executor lifecycle phases
- 6:11Core data structures
- 12:28Execution of select queries
- 16:32Hash join execution
- 19:35Modification queries
- 22:31Parallel query execution
- 27:58Expression evaluation
- 32:30Memory management
- 36:11Conclusion and Q&A
related talks
32mHacking Postgres Executor For Performance
47mHacking Postgres Executor For Performance
51mHow does PostgreSQL actually work
52mUnderstanding PostgreSQL Query Plans (aka EXPLAIN)
23mFollowing Select Statements Through Citus Internals
22mParallel Processing in PostgreSQL
38mParallelism in PostgreSQL 15
29mExplaining the Postgres Query Optimizer
