postgres-impl-partitioning
Installation
SKILL.md
postgres-impl-partitioning
Quick Reference :
Declarative partitioning splits one logical table into many physical child tables by a partition key. The planner skips children that cannot hold matching rows (partition pruning), so big-table scans touch only relevant data.
Three strategies :
- RANGE : ordered ranges of the key. Time-series, sequential ids. Bounds are lower-inclusive, upper-exclusive.
- LIST : explicit value sets. Discrete categories (region, tenant, status).
- HASH : hash modulus + remainder. Even distribution when no natural range or list exists.
Two rules govern every partitioned query :