forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd2ca9a5
committed
Minor corrections for partition pruning
When the partition pruning code finds an OpExpr with an operator thatdoes not belong to the partition key's opfamily, the code checks to seeif the negator of the operator is the opfamily's BTEqualStrategyNumberoperator so that partition pruning can support that operator and invertthe matching partitions. Doing this only works for LIST partitionedtables.Here we fix a minor correctness issue where when we discover we're notpruning for a LIST partitioned table, we return PARTCLAUSE_NOMATCH.PARTCLAUSE_NOMATCH is only meant to be used when the clause may matchanother partitioned key column. For this case, the clause is not goingto be any more useful to another partitioned key as the partition strategyis not going to change from one key to the next.Noticed while working4c2369a. No backpatch because returningPARTCLAUSE_NOMATCH instead of PARTCLAUSE_UNSUPPORTED mostly just causeswasted effort checking subsequent partition keys against a clause thatwill never be used for pruning.In passing, correct a comment for get_matching_range_bounds() whichmentions that an 'opstrategy' of 0 is supported. It's not, so fix thecomment. This was pointed out by Alexander Lakhin.Discussion:https://postgr.es/m/CAApHDvqriy8mPOFJ_Bd66YGXJ4+XULpv-4YdB+ePdCQFztyisA@mail.gmail.comDiscussion:https://postgr.es/m/312fb507-9b5e-cf83-d8ed-cd0da72a902c@gmail.com1 parent818fefd commitd2ca9a5
1 file changed
+8
-5
lines changedLines changed: 8 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1936 | 1936 |
| |
1937 | 1937 |
| |
1938 | 1938 |
| |
1939 |
| - | |
1940 |
| - | |
1941 |
| - | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
1942 | 1944 |
| |
1943 | 1945 |
| |
1944 | 1946 |
| |
| |||
1948 | 1950 |
| |
1949 | 1951 |
| |
1950 | 1952 |
| |
| 1953 | + | |
1951 | 1954 |
| |
1952 |
| - | |
| 1955 | + | |
1953 | 1956 |
| |
1954 | 1957 |
| |
1955 | 1958 |
| |
| |||
2924 | 2927 |
| |
2925 | 2928 |
| |
2926 | 2929 |
| |
2927 |
| - | |
| 2930 | + | |
2928 | 2931 |
| |
2929 | 2932 |
| |
2930 | 2933 |
| |
|
0 commit comments
Comments
(0)