From 5a7471c307533a1b56260b3b074dfdd20e1be5ae Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 22 Jan 2007 01:35:23 +0000 Subject: 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. --- doc/src/sgml/ref/alter_function.sgml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'doc/src/sgml/ref/alter_function.sgml') diff --git a/doc/src/sgml/ref/alter_function.sgml b/doc/src/sgml/ref/alter_function.sgml index d56437538e9..150ca3d418f 100644 --- a/doc/src/sgml/ref/alter_function.sgml +++ b/doc/src/sgml/ref/alter_function.sgml @@ -1,5 +1,5 @@ @@ -34,6 +34,8 @@ where action is one of: CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT IMMUTABLE | STABLE | VOLATILE [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER + COST execution_cost + ROWS result_rows @@ -186,6 +188,30 @@ where action is one of: + + COST execution_cost + + + + Change the estimated execution cost of the function. + See for more information. + + + + + + ROWS result_rows + + + + Change the estimated number of rows returned by a set-returning + function. See for more information. + + + + RESTRICT -- cgit v1.2.3