summaryrefslogtreecommitdiff
path: root/src/backend/commands/proclang.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-01-22 01:35:23 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-01-22 01:35:23 +0000
commit5a7471c307533a1b56260b3b074dfdd20e1be5ae (patch)
tree6a3cff705e779eefac734882a66aee1631224394 /src/backend/commands/proclang.c
parenta85e9c61e579b15d0635e04870cf1cb069fdf9ee (diff)
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/commands/proclang.c')
-rw-r--r--src/backend/commands/proclang.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c
index d5300573400..028ab5e5217 100644
--- a/src/backend/commands/proclang.c
+++ b/src/backend/commands/proclang.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/proclang.c,v 1.70 2007/01/05 22:19:26 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/proclang.c,v 1.71 2007/01/22 01:35:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -130,7 +130,9 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
buildoidvector(funcargtypes, 0),
PointerGetDatum(NULL),
PointerGetDatum(NULL),
- PointerGetDatum(NULL));
+ PointerGetDatum(NULL),
+ 1,
+ 0);
}
/*
@@ -160,7 +162,9 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
buildoidvector(funcargtypes, 1),
PointerGetDatum(NULL),
PointerGetDatum(NULL),
- PointerGetDatum(NULL));
+ PointerGetDatum(NULL),
+ 1,
+ 0);
}
}
else