mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	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:
		@@ -7,7 +7,7 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * IDENTIFICATION
 | 
					 * 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) {
 | 
					    foreach(x, new_rels) {
 | 
				
			||||||
	rel = (Rel*)lfirst(x);
 | 
						rel = (Rel*)lfirst(x);
 | 
				
			||||||
 | 
					#if 0	/* compute_joinrel_size already called by prune_rel_paths */
 | 
				
			||||||
	rel->size = compute_rel_size(rel);
 | 
						rel->size = compute_rel_size(rel);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	rel->width = compute_rel_width(rel);
 | 
						rel->width = compute_rel_width(rel);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*#define OPTIMIZER_DEBUG*/
 | 
					/*#define OPTIMIZER_DEBUG*/
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,7 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * IDENTIFICATION
 | 
					 * 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)),
 | 
										get_base_rel(root, lfirsti(other_rels)),
 | 
				
			||||||
					joininfo);
 | 
										joininfo);
 | 
				
			||||||
		    /* how about right-sided plan ? */
 | 
							    /* how about right-sided plan ? */
 | 
				
			||||||
		    if ( _use_right_sided_plans_ )
 | 
							    if ( _use_right_sided_plans_ && 
 | 
				
			||||||
 | 
							    		length (outer_rel->relids) > 1 )
 | 
				
			||||||
		    {
 | 
							    {
 | 
				
			||||||
		    	if (rel != NULL)
 | 
							    	if (rel != NULL)
 | 
				
			||||||
		    	    join_list = lappend(join_list, rel);
 | 
							    	    join_list = lappend(join_list, rel);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user