aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2024-02-20 18:34:21 +1300
committerDavid Rowley <drowley@postgresql.org>2024-02-20 18:34:21 +1300
commitd2ca9a50b5b99ef29aa65b68b5e6ddb253fbb04a (patch)
tree25b5a66f3a1db832486bcd8bb32df75321876a14 /src/backend/parser/parse_utilcmd.c
parent818fefd8fd4412d45eb542155cb2833a2b864acc (diff)
downloadpostgresql-d2ca9a50b5b99ef29aa65b68b5e6ddb253fbb04a.tar.gz
postgresql-d2ca9a50b5b99ef29aa65b68b5e6ddb253fbb04a.zip
Minor corrections for partition pruning
When the partition pruning code finds an OpExpr with an operator that does not belong to the partition key's opfamily, the code checks to see if the negator of the operator is the opfamily's BTEqualStrategyNumber operator so that partition pruning can support that operator and invert the matching partitions. Doing this only works for LIST partitioned tables. Here we fix a minor correctness issue where when we discover we're not pruning for a LIST partitioned table, we return PARTCLAUSE_NOMATCH. PARTCLAUSE_NOMATCH is only meant to be used when the clause may match another partitioned key column. For this case, the clause is not going to be any more useful to another partitioned key as the partition strategy is not going to change from one key to the next. Noticed while working 4c2369ac5. No backpatch because returning PARTCLAUSE_NOMATCH instead of PARTCLAUSE_UNSUPPORTED mostly just causes wasted effort checking subsequent partition keys against a clause that will never be used for pruning. In passing, correct a comment for get_matching_range_bounds() which mentions that an 'opstrategy' of 0 is supported. It's not, so fix the comment. This was pointed out by Alexander Lakhin. Discussion: https://postgr.es/m/CAApHDvqriy8mPOFJ_Bd66YGXJ4+XULpv-4YdB+ePdCQFztyisA@mail.gmail.com Discussion: https://postgr.es/m/312fb507-9b5e-cf83-d8ed-cd0da72a902c@gmail.com
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions