mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Add support for FUNCTION RTEs to build_physical_tlist(), so that the
physical-tlist optimization can be applied to FunctionScan nodes as well as regular tables and SubqueryScans.
This commit is contained in:
		@@ -10,7 +10,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * IDENTIFICATION
 | 
			
		||||
 *	  $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.189 2005/05/22 22:30:19 tgl Exp $
 | 
			
		||||
 *	  $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.190 2005/05/30 18:55:49 tgl Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -308,13 +308,17 @@ use_physical_tlist(RelOptInfo *rel)
 | 
			
		||||
	int			i;
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * OK for subquery scans, but not function scans.  (This is mainly
 | 
			
		||||
	 * because build_physical_tlist doesn't support them; worth adding?)
 | 
			
		||||
	 * OK for subquery and function scans; otherwise, can't do it for
 | 
			
		||||
	 * anything except real relations.
 | 
			
		||||
	 */
 | 
			
		||||
	if (rel->rtekind == RTE_SUBQUERY)
 | 
			
		||||
		return true;
 | 
			
		||||
	if (rel->rtekind != RTE_RELATION)
 | 
			
		||||
	{
 | 
			
		||||
		if (rel->rtekind == RTE_SUBQUERY)
 | 
			
		||||
			return true;
 | 
			
		||||
		if (rel->rtekind == RTE_FUNCTION)
 | 
			
		||||
			return true;
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Can't do it with inheritance cases either (mainly because Append
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user