diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-22 01:35:23 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-22 01:35:23 +0000 |
| commit | 5a7471c307533a1b56260b3b074dfdd20e1be5ae (patch) | |
| tree | 6a3cff705e779eefac734882a66aee1631224394 /src/backend/utils/Gen_fmgrtab.sh | |
| parent | a85e9c61e579b15d0635e04870cf1cb069fdf9ee (diff) | |
| download | postgresql-5a7471c307533a1b56260b3b074dfdd20e1be5ae.tar.gz | |
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.
Diffstat (limited to 'src/backend/utils/Gen_fmgrtab.sh')
| -rw-r--r-- | src/backend/utils/Gen_fmgrtab.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/utils/Gen_fmgrtab.sh b/src/backend/utils/Gen_fmgrtab.sh index f3cb4abea4..ccd2da3d63 100644 --- a/src/backend/utils/Gen_fmgrtab.sh +++ b/src/backend/utils/Gen_fmgrtab.sh @@ -9,7 +9,7 @@ # # # IDENTIFICATION -# $PostgreSQL: pgsql/src/backend/utils/Gen_fmgrtab.sh,v 1.34 2007/01/05 22:19:39 momjian Exp $ +# $PostgreSQL: pgsql/src/backend/utils/Gen_fmgrtab.sh,v 1.35 2007/01/22 01:35:21 tgl Exp $ # #------------------------------------------------------------------------- @@ -72,6 +72,8 @@ trap 'echo "Caught signal." ; cleanup ; exit 1' 1 2 15 # # Generate the file containing raw pg_proc tuple data # (but only for "internal" language procedures...). +# Basically we strip off the DATA macro call, leaving procedure OID as $1 +# and all the pg_proc field values as $2, $3, etc on each line. # # Note assumption here that prolang == $5 and INTERNALlanguageId == 12. # @@ -202,15 +204,15 @@ FuNkYfMgRtAbStUfF # may seem tedious, but avoid the temptation to write a quick x?y:z # conditional expression instead. Not all awks have conditional expressions. # -# Note assumptions here that prosrc == $(NF-2), pronargs == $11, -# proisstrict == $8, proretset == $9 +# Note assumptions here that prosrc == $(NF-2), pronargs == $13, +# proisstrict == $10, proretset == $11 $AWK 'BEGIN { Bool["t"] = "true" Bool["f"] = "false" } { printf (" { %d, \"%s\", %d, %s, %s, %s },\n"), \ - $1, $(NF-2), $11, Bool[$8], Bool[$9], $(NF-2) + $1, $(NF-2), $13, Bool[$10], Bool[$11], $(NF-2) }' $SORTEDFILE >> "$$-$TABLEFILE" if [ $? -ne 0 ]; then |
