Prune PostgreSQL partitions on any column using CHECK constraints
PostgreSQL can prune partitions even when a query filters on a non‑partition column. By adding CHECK constraints that mirror the partition key’s range logic, the planner can safely exclude whole partitions, slashing scan size and latency without reshaping the schema. This trick turns a hard partition‑key rule into a flexible performance win.