summaryrefslogtreecommitdiff
path: root/src/test/regress/sql/opr_sanity.sql
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/test/regress/sql/opr_sanity.sql
parenta85e9c61e579b15d0635e04870cf1cb069fdf9ee (diff)
downloadpostgresql-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/test/regress/sql/opr_sanity.sql')
-rw-r--r--src/test/regress/sql/opr_sanity.sql4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql
index b8c184f784..7eff2195df 100644
--- a/src/test/regress/sql/opr_sanity.sql
+++ b/src/test/regress/sql/opr_sanity.sql
@@ -53,7 +53,9 @@ WHERE p1.prolang = 0 OR p1.prorettype = 0 OR
p1.pronargs < 0 OR
array_lower(p1.proargtypes, 1) != 0 OR
array_upper(p1.proargtypes, 1) != p1.pronargs-1 OR
- 0::oid = ANY (p1.proargtypes);
+ 0::oid = ANY (p1.proargtypes) OR
+ procost <= 0 OR
+ CASE WHEN proretset THEN prorows <= 0 ELSE prorows != 0 END;
-- Look for conflicting proc definitions (same names and input datatypes).
-- (This test should be dead code now that we have the unique index