Partition pruning
Eliminating partitions at plan time and during execution (run-time pruning) using partition bounds. Introduced in PostgreSQL 11.
Versions
- PostgreSQL 20 · worked-on · improved · moderate
- PostgreSQL 18 · worked-on · improved · moderate
- PostgreSQL 17 · shipped · improved · minor · 1 commit · +93 / -41 lines
Threads
- BUG #19883: Partition pruning errors on SubPlan inside = ANY array
- Re: Partition-aware simplification of constant IN lists after partition pruning
- Partition-aware simplification of constant IN lists after partition pruning
- Subject: Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
- RANGE partition pruning can still exclude the default partition
- BUG #19692: Generic partition-pruning plan delays statement_timeout cancellation
- More partition pruning bugs with multi-column RANGE partitions
- Partition pruning can incorrectly exclude a RANGE default partition
- Potential partition pruning regression on PostgreSQL 18
- Partition pruning on parameters grouped into an array does not prune properly
- Prune partitions by ScalarArrayOpExpr with an array parameter (partkey = ANY($1))
- BUG #18778: Query planning fails in ExecInitExprRec with unrecognized node type
- Support run-time partition pruning for hash join
- BUG #18440: Query does not prune partitions correctly or use index when prepared statements are used
- Support boolcol IS [NOT] UNKNOWN in partition pruning
- BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy
- Problem, partition pruning for prepared statement with IS NULL clause.
- [question] multil-column range partition prune
- Partition pruning not working on updates
- Unexpected (wrong?) result querying boolean partitioned table with NULL partition
- Generating "Subplan Removed" in EXPLAIN
- wrong Append/MergeAppend elision?
- BUG #17650: For the sixth time, the clipping function in the 120 partition table planning stage fails
- BUG #17484: Query does not prune partitions correctly
- BUG #17442: Wrong partition pruning when using prepared statement and huge RAM consumption
- Question on partition pruning involving stable operator: timestamptz_ge_date
- Parallel Append can break run-time partition pruning
- Make Append Cost aware of some run time partition prune case
- BUG #17270: Partitions are not prunned for generic plans when `ANY` construct is used.
- Record a Bitmapset of non-pruned partitions
- update/delete and execution-time partition pruning
- Consider parent's stats for set_append_rel_size.
- Wired if-statement in gen_partprune_steps_internal
- Performing partition pruning using row value
- Cost model improvement for run-time partition prune
- Extend more usecase for planning time partition pruning and init partition pruning.
- BUG #16855: No partition pruning when using partitions with custom hash function
- [sqlsmith] Failed assertion during partition pruning
- Assertion fail with window function and partitioned tables
- BUG #16840: Rows not found in table partitioned by hash when not all partitions exists
- BUG #16745: delete does not prune partitions on declarative partitioned table
- Partition prune with stable Expr
- Runtime Partition Pruning
- Improve choose_custom_plan for initial partition prune case
- Yet another issue with step generation in partition pruning
- FailedAssertion("pd_idx == pinfo->nparts", File: "execPartition.c", Line: 1689)
- BUG #16500: SQL Abend. select multi_key_columns_range_partition_table
- BUG #16501: Incorrect result. select multi_key_columns_range_partition_table
- Equality of columns isn't taken in account when performing partition pruning
- Run-time pruning for ModifyTable
- BUG #16249: Partition pruning blocks on exclusively locked table partition
- BUG #16171: Potential malformed JSON in explain output
- BUG #16201: Second column in Range Partition is scanning all the partitions
- BUG #16163: Seq scan through all the partitions on a partitioned table when joined small, dictionary table.
- Runtime pruning problem
- Typo in perform.sgml?
- Instability of partition_prune regression test results
- Fix example in partitioning documentation
- Problem with default partition pruning
- Recovery mode with partitioned tables and ANY(NULL) in WHERE clause
- pgsql: Improve pruning of a default partition
- BUG #15917: Runtime Partition Pruning does not seem to work in PG 11
- [RFC] [PATCH] Flexible "partition pruning" hook
- PG11 - Multiple Key Range Partition
- Why does not subquery pruning conditions inherit to parent query?
- inconsistent results querying table partitioned by date
- Turning off enable_partition_pruning doesn't
- BUG #15779: Partition elimination doesn't work as expected when using PARTITION BY RANGE
- Should we add GUCs to allow partition pruning to be disabled?
- selecting from partitions and constraint exclusion
- BUG #15629: Typo in Documentation
- slight tweaks to documentation about runtime pruning
- Small performance tweak to run-time partition pruning
- Some incorrect comments and out-dated README from run-time pruning
- Small run-time pruning doc fix
- Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian
- FailedAssertion on partprune
- document that MergeAppend can now prune
- BUG #15334: Partition elimination not working as expected when using enum as partition key
- [sqlsmith] ERROR: partition missing from subplans
- pgsql: Fix run-time partition pruning for appends with multiple source
- negative bitmapset member not allowed Error with partition pruning
- Scanning all partition when more than 100 items in "where id in ()" clause
- BUG #15301: Scanning all partition when more than 100 items in "where id in ()" clause
- cached plans and enable_partition_pruning
- Runtime partition pruning for MergeAppend
- why partition pruning doesn't work?
- partition pruning doesn't work with IS NULL clause in multikey range partition case
- Run-time partition pruning and EXPLAIN [ANALYZE]
- partition -> partitioned
- Getting "ERROR: did not find all requested child rels in append_rel_list" when enable_partition_pruning is on
- Should total_pages be calculated after partition pruning and constraint exclusion?
- path toward faster partition pruning
- pruning disabled for array, enum, record, range type partition keys
- pgsql: Support partition pruning at execution time
- Test coverage for mark_invalid_subplans_as_finished
- Instability in partition_prune test?
- [sqlsmith] Failed assertion on pfree() via perform_pruning_combine_step
- Proposal: partition pruning by secondary attributes
- Partition pruning for Star Schema