mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
IN clauses appearing at top level of WHERE can now be handled as joins.
There are two implementation techniques: the executor understands a new JOIN_IN jointype, which emits at most one matching row per left-hand row, or the result of the IN's sub-select can be fed through a DISTINCT filter and then joined as an ordinary relation. Along the way, some minor code cleanup in the optimizer; notably, break out most of the jointree-rearrangement preprocessing in planner.c and put it in a new file prep/prepjointree.c.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: parsenodes.h,v 1.225 2003/01/06 00:31:45 tgl Exp $
|
||||
* $Id: parsenodes.h,v 1.226 2003/01/20 18:55:00 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -101,6 +101,7 @@ typedef struct Query
|
||||
List *join_rel_list; /* list of join-relation RelOptInfos */
|
||||
List *equi_key_list; /* list of lists of equijoined
|
||||
* PathKeyItems */
|
||||
List *in_info_list; /* list of InClauseInfos */
|
||||
List *query_pathkeys; /* desired pathkeys for query_planner() */
|
||||
bool hasJoinRTEs; /* true if any RTEs are RTE_JOIN kind */
|
||||
} Query;
|
||||
|
||||
Reference in New Issue
Block a user