Lab 09 — Partitioning
Scenario
A recent-activity query counts events from the last day. This lab evaluates whether partition pruning can reduce the data considered and whether partitioning is justified operationally.
Run the exercise
Investigate
- Record the current scan, rows filtered, and buffers.
- Inspect the time distribution and total size of
customer_activity. - Propose a partition key and interval aligned with retention and queries.
- Explain static or runtime pruning evidence you would expect.
- Account for migration, index duplication, vacuum, and partition lifecycle costs.
Diagnostic question
Would partitioning materially reduce work for this dataset, or would a simpler access path meet the requirement with less operational cost?