diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-02-06 23:43:24 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-02-06 23:43:24 +0000 |
| commit | c473d923515e03fe5fd43c2ca15d52363a93f488 (patch) | |
| tree | ca1de3f8f20beb73fbd244f9f24e0e1fd7a3ca22 /src/backend/optimizer/path/orindxpath.c | |
| parent | c87c31f10bfd77234b62175f03b9ae8a6f961411 (diff) | |
| download | postgresql-c473d923515e03fe5fd43c2ca15d52363a93f488.tar.gz | |
Fix cost_mergejoin's failure to adjust for rescanning of non-unique merge join
keys when considering a semi or anti join. This requires estimating the
selectivity of the merge qual as though it were a regular inner join condition.
To allow caching both that and the real outer-join-aware selectivity, split
RestrictInfo.this_selec into two fields.
This fixes one of the problems reported by Kevin Grittner.
Diffstat (limited to 'src/backend/optimizer/path/orindxpath.c')
| -rw-r--r-- | src/backend/optimizer/path/orindxpath.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/optimizer/path/orindxpath.c b/src/backend/optimizer/path/orindxpath.c index a82f1c8b82..638078e169 100644 --- a/src/backend/optimizer/path/orindxpath.c +++ b/src/backend/optimizer/path/orindxpath.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/orindxpath.c,v 1.86 2009/01/01 17:23:44 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/orindxpath.c,v 1.87 2009/02/06 23:43:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -174,10 +174,11 @@ create_or_index_quals(PlannerInfo *root, RelOptInfo *rel) { orig_selec = clause_selectivity(root, (Node *) bestrinfo, 0, JOIN_INNER, NULL); - bestrinfo->this_selec = orig_selec / or_selec; + bestrinfo->norm_selec = orig_selec / or_selec; /* clamp result to sane range */ - if (bestrinfo->this_selec > 1) - bestrinfo->this_selec = 1; + if (bestrinfo->norm_selec > 1) + bestrinfo->norm_selec = 1; + /* It isn't an outer join clause, so no need to adjust outer_selec */ } /* Tell caller to recompute rel's rows estimate */ |
