]> granicus.if.org Git - postgresql/commit
Add COST and ROWS options to CREATE/ALTER FUNCTION, plus underlying pg_proc
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 22 Jan 2007 01:35:23 +0000 (01:35 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 22 Jan 2007 01:35:23 +0000 (01:35 +0000)
commit5a7471c307533a1b56260b3b074dfdd20e1be5ae
tree6a3cff705e779eefac734882a66aee1631224394
parenta85e9c61e579b15d0635e04870cf1cb069fdf9ee
Add COST and ROWS options to CREATE/ALTER FUNCTION, plus underlying pg_proc
columns procost and prorows, to allow simple user adjustment of the estimated
cost of a function call, as well as control of the estimated number of rows
returned by a set-returning function.  We might eventually wish to extend this
to allow function-specific estimation routines, but there seems to be
consensus that we should try a simple constant estimate first.  In particular
this provides a relatively simple way to control the order in which different
WHERE clauses are applied in a plan node, which is a Good Thing in view of the
fact that the recent EquivalenceClass planner rewrite made that much less
predictable than before.
27 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/ref/alter_function.sgml
doc/src/sgml/ref/create_function.sgml
src/backend/bootstrap/bootstrap.c
src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_proc.c
src/backend/commands/functioncmds.c
src/backend/commands/proclang.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/util/clauses.c
src/backend/parser/gram.y
src/backend/parser/keywords.c
src/backend/utils/Gen_fmgrtab.sh
src/backend/utils/cache/lsyscache.c
src/bin/pg_dump/pg_dump.c
src/include/catalog/catversion.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_class.h
src/include/catalog/pg_proc.h
src/include/optimizer/clauses.h
src/include/optimizer/cost.h
src/include/optimizer/planmain.h
src/include/utils/lsyscache.h
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/opr_sanity.sql