Fix partition pruning with IS [NOT] NULL clauses

The original code was unable to prune partitions that could not possibly
contain NULL values, when the query specified less than all columns in a
multicolumn partition key.  Reorder the if-tests so that it is, and add
more commentary and regression tests.

Reported-by: Ashutosh Bapat <[email protected]>
Co-authored-by: Dilip Kumar <[email protected]>
Co-authored-by: Amit Langote <[email protected]>
Co-authored-by: Álvaro Herrera <[email protected]>
Reviewed-by: Ashutosh Bapat <[email protected]>
Reviewed-by: amul sul <[email protected]>
Discussion: 
https://postgr.es/m/CAFjFpRc7qjLUfXLVBBC_HAnx644sjTYM=qvot3tj840hpbs...@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fb2b61a21e141843697de7982c9f6485effcd915

Modified Files
--------------
src/backend/partitioning/partprune.c          | 78 ++++++++++++++-------------
src/test/regress/expected/partition_prune.out | 41 ++++++++++++++
src/test/regress/sql/partition_prune.sql      |  7 +++
3 files changed, 90 insertions(+), 36 deletions(-)

Reply via email to