mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
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.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.228 2007/01/05 22:19:24 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.229 2007/01/22 01:35:19 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -115,16 +115,18 @@ static const struct typinfo TypInfo[] = {
|
||||
F_BYTEAIN, F_BYTEAOUT},
|
||||
{"char", CHAROID, 0, 1, true, 'c', 'p',
|
||||
F_CHARIN, F_CHAROUT},
|
||||
{"name", NAMEOID, CHAROID, NAMEDATALEN, false, 'i', 'p',
|
||||
F_NAMEIN, F_NAMEOUT},
|
||||
{"int2", INT2OID, 0, 2, true, 's', 'p',
|
||||
F_INT2IN, F_INT2OUT},
|
||||
{"int4", INT4OID, 0, 4, true, 'i', 'p',
|
||||
F_INT4IN, F_INT4OUT},
|
||||
{"regproc", REGPROCOID, 0, 4, true, 'i', 'p',
|
||||
F_REGPROCIN, F_REGPROCOUT},
|
||||
{"float4", FLOAT4OID, 0, 4, false, 'i', 'p',
|
||||
F_FLOAT4IN, F_FLOAT4OUT},
|
||||
{"name", NAMEOID, CHAROID, NAMEDATALEN, false, 'i', 'p',
|
||||
F_NAMEIN, F_NAMEOUT},
|
||||
{"regclass", REGCLASSOID, 0, 4, true, 'i', 'p',
|
||||
F_REGCLASSIN, F_REGCLASSOUT},
|
||||
{"regproc", REGPROCOID, 0, 4, true, 'i', 'p',
|
||||
F_REGPROCIN, F_REGPROCOUT},
|
||||
{"regtype", REGTYPEOID, 0, 4, true, 'i', 'p',
|
||||
F_REGTYPEIN, F_REGTYPEOUT},
|
||||
{"text", TEXTOID, 0, -1, false, 'i', 'x',
|
||||
|
Reference in New Issue
Block a user