From ac25dbd84bbcc288fc93f4053b6df4b848cf5bc6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 30 May 2005 18:55:49 +0000 Subject: 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. --- src/backend/optimizer/plan/createplan.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/backend/optimizer/plan/createplan.c') diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 930355b5204..b743c8348ed 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -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 -- cgit v1.2.3