mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Support "Right Anti Join" plan shapes.
Merge and hash joins can support antijoin with the non-nullable input on the right, using very simple combinations of their existing logic for right join and anti join. This gives the planner more freedom about how to order the join. It's particularly useful for hash join, since we may now have the option to hash the smaller table instead of the larger. Richard Guo, reviewed by Ronan Dunklau and myself Discussion: https://postgr.es/m/CAMbWs48xh9hMzXzSy3VaPzGAz+fkxXXTUbCLohX1_L8THFRm2Q@mail.gmail.com
This commit is contained in:
@@ -317,6 +317,7 @@ typedef enum JoinType
|
||||
*/
|
||||
JOIN_SEMI, /* 1 copy of each LHS row that has match(es) */
|
||||
JOIN_ANTI, /* 1 copy of each LHS row that has no match */
|
||||
JOIN_RIGHT_ANTI, /* 1 copy of each RHS row that has no match */
|
||||
|
||||
/*
|
||||
* These codes are used internally in the planner, but are not supported
|
||||
@@ -349,7 +350,8 @@ typedef enum JoinType
|
||||
((1 << JOIN_LEFT) | \
|
||||
(1 << JOIN_FULL) | \
|
||||
(1 << JOIN_RIGHT) | \
|
||||
(1 << JOIN_ANTI))) != 0)
|
||||
(1 << JOIN_ANTI) | \
|
||||
(1 << JOIN_RIGHT_ANTI))) != 0)
|
||||
|
||||
/*
|
||||
* AggStrategy -
|
||||
|
||||
Reference in New Issue
Block a user