diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-04-05 00:31:36 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-04-05 00:31:36 +0000 |
commit | 4bdb4be62e652ee3220dae21a4fa340832c93429 (patch) | |
tree | f1b39eb4cbcc1a8fca748304770a72aec96cd472 /src/backend/utils/cache | |
parent | 0e11aea246a462e503a73908c9fc143b9f2da16a (diff) | |
download | postgresql-4bdb4be62e652ee3220dae21a4fa340832c93429.tar.gz postgresql-4bdb4be62e652ee3220dae21a4fa340832c93429.zip |
Divide functions into three volatility classes (immutable, stable, and
volatile), rather than the old cachable/noncachable distinction. This
allows indexscan optimizations in many places where we formerly didn't.
Also, add a pronamespace column to pg_proc (it doesn't do anything yet,
however).
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 24 | ||||
-rw-r--r-- | src/backend/utils/cache/syscache.c | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index bf0981e6372..17ea1abdd0c 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.68 2002/04/02 01:03:07 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.69 2002/04/05 00:31:30 tgl Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -470,19 +470,19 @@ op_hashjoinable(Oid opno, Oid ltype, Oid rtype) } /* - * op_iscachable + * op_volatile * - * Get the proiscachable flag for the operator's underlying function. + * Get the provolatile flag for the operator's underlying function. */ -bool -op_iscachable(Oid opno) +char +op_volatile(Oid opno) { RegProcedure funcid = get_opcode(opno); if (funcid == (RegProcedure) InvalidOid) elog(ERROR, "Operator OID %u does not exist", opno); - return func_iscachable((Oid) funcid); + return func_volatile((Oid) funcid); } /* @@ -613,14 +613,14 @@ get_func_rettype(Oid funcid) } /* - * func_iscachable - * Given procedure id, return the function's proiscachable flag. + * func_volatile + * Given procedure id, return the function's provolatile flag. */ -bool -func_iscachable(Oid funcid) +char +func_volatile(Oid funcid) { HeapTuple tp; - bool result; + char result; tp = SearchSysCache(PROCOID, ObjectIdGetDatum(funcid), @@ -628,7 +628,7 @@ func_iscachable(Oid funcid) if (!HeapTupleIsValid(tp)) elog(ERROR, "Function OID %u does not exist", funcid); - result = ((Form_pg_proc) GETSTRUCT(tp))->proiscachable; + result = ((Form_pg_proc) GETSTRUCT(tp))->provolatile; ReleaseSysCache(tp); return result; } diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index 7f988782c75..84cea0bb632 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.72 2002/03/31 06:26:32 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.73 2002/04/05 00:31:31 tgl Exp $ * * NOTES * These routines allow the parser/planner/executor to perform @@ -304,7 +304,7 @@ static const struct cachedesc cacheinfo[] = { 0 }}, {ProcedureRelationName, /* PROCNAME */ - ProcedureNameIndex, + ProcedureNameNspIndex, /* XXX very temporary */ 0, 3, { |