diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-10-06 23:21:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-10-06 23:21:45 +0000 |
commit | 85801a4dbdee22f230637311681b8b03a72979db (patch) | |
tree | 28054ba90fda332be0d5254e5bdaba5a2a51f1f2 /src/backend/utils/adt/ri_triggers.c | |
parent | a965750abf2504e266e5071dc90365be9485395a (diff) | |
download | postgresql-85801a4dbdee22f230637311681b8b03a72979db.tar.gz postgresql-85801a4dbdee22f230637311681b8b03a72979db.zip |
Rearrange fmgr.c and relcache so that it's possible to keep FmgrInfo
lookup info in the relcache for index access method support functions.
This makes a huge difference for dynamically loaded support functions,
and should save a few cycles even for built-in ones. Also tweak dfmgr.c
so that load_external_function is called only once, not twice, when
doing fmgr_info for a dynamically loaded function. All per performance
gripe from Teodor Sigaev, 5-Oct-01.
Diffstat (limited to 'src/backend/utils/adt/ri_triggers.c')
-rw-r--r-- | src/backend/utils/adt/ri_triggers.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c index ebbb8b07ee8..a03ca774408 100644 --- a/src/backend/utils/adt/ri_triggers.c +++ b/src/backend/utils/adt/ri_triggers.c @@ -18,7 +18,7 @@ * Portions Copyright (c) 2000-2001, PostgreSQL Global Development Group * Copyright 1999 Jan Wieck * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.27 2001/10/05 17:28:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.28 2001/10/06 23:21:44 tgl Exp $ * * ---------- */ @@ -3243,7 +3243,6 @@ ri_AttributesEqual(Oid typeid, Datum oldvalue, Datum newvalue) { HeapTuple opr_tup; Oid opr_proc; - MemoryContext oldcontext; FmgrInfo finfo; opr_tup = SearchSysCache(OPERNAME, @@ -3265,9 +3264,7 @@ ri_AttributesEqual(Oid typeid, Datum oldvalue, Datum newvalue) * table entry, we must make sure any subsidiary structures of the * fmgr record are kept in TopMemoryContext. */ - oldcontext = MemoryContextSwitchTo(TopMemoryContext); - fmgr_info(opr_proc, &finfo); - MemoryContextSwitchTo(oldcontext); + fmgr_info_cxt(opr_proc, &finfo, TopMemoryContext); entry = (RI_OpreqHashEntry *) hash_search(ri_opreq_cache, (void *) &typeid, |