diff options
| author | Tom Lane | 2001-10-06 23:21:45 +0000 |
|---|---|---|
| committer | Tom Lane | 2001-10-06 23:21:45 +0000 |
| commit | 85801a4dbdee22f230637311681b8b03a72979db (patch) | |
| tree | 28054ba90fda332be0d5254e5bdaba5a2a51f1f2 /src/backend/access/rtree | |
| parent | a965750abf2504e266e5071dc90365be9485395a (diff) | |
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/access/rtree')
| -rw-r--r-- | src/backend/access/rtree/rtree.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/backend/access/rtree/rtree.c b/src/backend/access/rtree/rtree.c index f3b46f3144b..42878248b00 100644 --- a/src/backend/access/rtree/rtree.c +++ b/src/backend/access/rtree/rtree.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.64 2001/09/29 03:46:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.65 2001/10/06 23:21:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1264,17 +1264,15 @@ rtbulkdelete(PG_FUNCTION_ARGS) static void initRtstate(RTSTATE *rtstate, Relation index) { - RegProcedure union_proc, - size_proc, - inter_proc; - - union_proc = index_getprocid(index, 1, RT_UNION_PROC); - size_proc = index_getprocid(index, 1, RT_SIZE_PROC); - inter_proc = index_getprocid(index, 1, RT_INTER_PROC); - fmgr_info(union_proc, &rtstate->unionFn); - fmgr_info(size_proc, &rtstate->sizeFn); - fmgr_info(inter_proc, &rtstate->interFn); - return; + fmgr_info_copy(&rtstate->unionFn, + index_getprocinfo(index, 1, RT_UNION_PROC), + CurrentMemoryContext); + fmgr_info_copy(&rtstate->sizeFn, + index_getprocinfo(index, 1, RT_SIZE_PROC), + CurrentMemoryContext); + fmgr_info_copy(&rtstate->interFn, + index_getprocinfo(index, 1, RT_INTER_PROC), + CurrentMemoryContext); } /* for sorting SPLITCOST records in descending order */ |
