constraint_exclusion
If you are using partitioned tables that use constraints, enabling constraint_exclusion
allows the planner to ignore partitions that can't have the data being searched for when that can be proven. This parameter originally defaulted to off
, meaning that unless toggled on partitioned tables, it will not work as expected. Starting in PostgreSQL 8.4, this was improved such that a new default value, partition
will do the right thing here in most cases without adding the overhead to the ones it isn't necessary for. It is theoretically possible to see a tiny performance improvement by turning this feature off in newer versions where it defaults to partition
, in cases where there are no partitions on your system.