Thread: pgsql: Arrange to "inline" SQL functions that appear in a query's FROM
pgsql: Arrange to "inline" SQL functions that appear in a query's FROM
From
tgl@postgresql.org (Tom Lane)
Date:
Log Message: ----------- Arrange to "inline" SQL functions that appear in a query's FROM clause, are declared to return set, and consist of just a single SELECT. We can replace the FROM-item with a sub-SELECT and then optimize much as if we were dealing with a view. Patch from Richard Rowell, cleaned up by me. Modified Files: -------------- pgsql/src/backend/catalog: pg_proc.c (r1.148 -> r1.149) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/pg_proc.c?r1=1.148&r2=1.149) pgsql/src/backend/executor: functions.c (r1.120 -> r1.121) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/functions.c?r1=1.120&r2=1.121) pgsql/src/backend/optimizer/plan: planner.c (r1.226 -> r1.227) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c?r1=1.226&r2=1.227) pgsql/src/backend/optimizer/prep: prepjointree.c (r1.49 -> r1.50) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepjointree.c?r1=1.49&r2=1.50) pgsql/src/backend/optimizer/util: clauses.c (r1.254 -> r1.255) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c?r1=1.254&r2=1.255) pgsql/src/include/executor: functions.h (r1.30 -> r1.31) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/functions.h?r1=1.30&r2=1.31) pgsql/src/include/optimizer: clauses.h (r1.88 -> r1.89) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/clauses.h?r1=1.88&r2=1.89) prep.h (r1.59 -> r1.60) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/prep.h?r1=1.59&r2=1.60)