diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-28 22:13:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-28 22:13:41 +0000 |
commit | 2e46b762eb1c15de2bcda785469a753a753747fb (patch) | |
tree | 54bb20d645df6e5bede49e6c405a93b137c65a20 /src/backend/optimizer/path/indxpath.c | |
parent | 955a1f81a702489102b2526e24631b9f51e14247 (diff) | |
download | postgresql-2e46b762eb1c15de2bcda785469a753a753747fb.tar.gz postgresql-2e46b762eb1c15de2bcda785469a753a753747fb.zip |
Extend join-selectivity API (oprjoin interface) so that join type is
passed to join selectivity estimators. Make use of this in eqjoinsel
to derive non-bogus selectivity for IN clauses. Further tweaking of
cost estimation for IN.
initdb forced because of pg_proc.h changes.
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 443d54c6473..98e4d59f2df 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.133 2003/01/24 03:58:34 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.134 2003/01/28 22:13:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1599,12 +1599,16 @@ make_innerjoin_index_path(Query *root, * selectivity. However, since RestrictInfo nodes aren't copied when * linking them into different lists, it should be sufficient to use * pointer comparison to remove duplicates.) + * + * Always assume the join type is JOIN_INNER; even if some of the + * join clauses come from other contexts, that's not our problem. */ pathnode->rows = rel->tuples * restrictlist_selectivity(root, set_ptrUnion(rel->baserestrictinfo, clausegroup), - lfirsti(rel->relids)); + lfirsti(rel->relids), + JOIN_INNER); /* Like costsize.c, force estimate to be at least one row */ if (pathnode->rows < 1.0) pathnode->rows = 1.0; |