Skip to content

Lab 13 — Advanced Execution

Scenario

A full order_items aggregation provides a workload for examining parallel execution, JIT, planner settings, caching, WAL, and checkpoint context without assuming each feature is beneficial.

Run the exercise

make shell
\i sql/labs/13-advanced/bad_queries.sql

Investigate

  1. Inspect worker planning and launch details, partial aggregates, and gather nodes.
  2. Record settings included in the plan before changing session parameters.
  3. Compare repeated runs to account for caching effects.
  4. Separate planning overhead, JIT overhead, CPU work, and I/O evidence.
  5. Evaluate throughput and concurrent workload impact, not only one query's latency.

Diagnostic question

Which advanced execution features are active, what measurable work do they save or add, and under what workload would that trade-off reverse?

Previous: Maintenance · Next: Beyond PostgreSQL