mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Restructure planning of nestloop inner indexscans so that the set of usable
joinclauses is determined accurately for each join. Formerly, the code only considered joinclauses that used all of the rels from the outer side of the join; thus for example FROM (a CROSS JOIN b) JOIN c ON (c.f1 = a.x AND c.f2 = b.y) could not exploit a two-column index on c(f1,f2), since neither of the qual clauses would be in the joininfo list it looked in. The new code does this correctly, and also is able to eliminate redundant clauses, thus fixing the problem noted 24-Oct-02 by Hans-Jürgen Schönig.
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.180 2002/11/15 02:50:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.181 2002/11/24 21:52:13 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@ -1067,12 +1067,8 @@ _outIndexPath(StringInfo str, IndexPath *node)
|
||||
appendStringInfo(str, " :indexqual ");
|
||||
_outNode(str, node->indexqual);
|
||||
|
||||
appendStringInfo(str, " :indexscandir %d :joinrelids ",
|
||||
(int) node->indexscandir);
|
||||
_outIntList(str, node->joinrelids);
|
||||
|
||||
appendStringInfo(str, " :alljoinquals %s :rows %.2f ",
|
||||
booltostr(node->alljoinquals),
|
||||
appendStringInfo(str, " :indexscandir %d :rows %.2f ",
|
||||
(int) node->indexscandir,
|
||||
node->rows);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user