allpaths.c:find_join_paths(): compute_rel_size() shouldn't be called

for join-relations. Sizes already computed by
prune_rel_paths():compute_joinrel_size().

joinrels.c:
<                   if ( _use_right_sided_plans_ )
---
>                   if ( _use_right_sided_plans_ &&
>                               length (outer_rel->relids) > 1 )

 - r_plans are useful when outer_rel is join-relation... It
decreases the size of search space...
This commit is contained in:
Vadim B. Mikheev 1997-06-05 09:33:52 +00:00
parent 39c73eff63
commit 11073bee5c
2 changed files with 6 additions and 3 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.8 1997/06/02 11:14:40 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.9 1997/06/05 09:33:50 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@ -216,7 +216,9 @@ find_join_paths(Query *root, List *outer_rels, int levels_left)
foreach(x, new_rels) {
rel = (Rel*)lfirst(x);
#if 0 /* compute_joinrel_size already called by prune_rel_paths */
rel->size = compute_rel_size(rel);
#endif
rel->width = compute_rel_width(rel);
/*#define OPTIMIZER_DEBUG*/

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.3 1997/05/20 10:37:26 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.4 1997/06/05 09:33:52 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@ -110,7 +110,8 @@ find_clause_joins(Query *root, Rel *outer_rel, List *joininfo_list)
get_base_rel(root, lfirsti(other_rels)),
joininfo);
/* how about right-sided plan ? */
if ( _use_right_sided_plans_ )
if ( _use_right_sided_plans_ &&
length (outer_rel->relids) > 1 )
{
if (rel != NULL)
join_list = lappend(join_list, rel);