Databases
Bug Report
Postgres partition pruning not applied: a cast on the key scanned all 36 partitions
Our monthly-partitioned orders table was supposed to make the daily report touch one partition. EXPLAIN showed all 36. A date cast on the partition key and a join-driven filter were blocking pruning, and two small query rewrites brought it back.