summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-10-06 23:21:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-10-06 23:21:45 +0000
commit85801a4dbdee22f230637311681b8b03a72979db (patch)
tree28054ba90fda332be0d5254e5bdaba5a2a51f1f2 /src/backend/access/gist/gist.c
parenta965750abf2504e266e5071dc90365be9485395a (diff)
downloadpostgresql-85801a4dbdee22f230637311681b8b03a72979db.tar.gz
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/gist/gist.c')
-rw-r--r--src/backend/access/gist/gist.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index e05e07b636..4a702fe317 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.83 2001/08/22 18:24:26 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.84 2001/10/06 23:21:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1542,13 +1542,6 @@ gistbulkdelete(PG_FUNCTION_ARGS)
void
initGISTstate(GISTSTATE *giststate, Relation index)
{
- RegProcedure consistent_proc,
- union_proc,
- compress_proc,
- decompress_proc,
- penalty_proc,
- picksplit_proc,
- equal_proc;
int i;
if (index->rd_att->natts > INDEX_MAX_KEYS)
@@ -1559,20 +1552,27 @@ initGISTstate(GISTSTATE *giststate, Relation index)
for (i = 0; i < index->rd_att->natts; i++)
{
- consistent_proc = index_getprocid(index, i+1, GIST_CONSISTENT_PROC );
- union_proc = index_getprocid(index, i+1, GIST_UNION_PROC );
- compress_proc = index_getprocid(index, i+1, GIST_COMPRESS_PROC );
- decompress_proc = index_getprocid(index, i+1, GIST_DECOMPRESS_PROC );
- penalty_proc = index_getprocid(index, i+1, GIST_PENALTY_PROC );
- picksplit_proc = index_getprocid(index, i+1, GIST_PICKSPLIT_PROC );
- equal_proc = index_getprocid(index, i+1, GIST_EQUAL_PROC );
- fmgr_info(consistent_proc, &((giststate->consistentFn)[i]) );
- fmgr_info(union_proc, &((giststate->unionFn)[i]) );
- fmgr_info(compress_proc, &((giststate->compressFn)[i]) );
- fmgr_info(decompress_proc, &((giststate->decompressFn)[i]) );
- fmgr_info(penalty_proc, &((giststate->penaltyFn)[i]) );
- fmgr_info(picksplit_proc, &((giststate->picksplitFn)[i]) );
- fmgr_info(equal_proc, &((giststate->equalFn)[i]) );
+ fmgr_info_copy(&(giststate->consistentFn[i]),
+ index_getprocinfo(index, i+1, GIST_CONSISTENT_PROC),
+ CurrentMemoryContext);
+ fmgr_info_copy(&(giststate->unionFn[i]),
+ index_getprocinfo(index, i+1, GIST_UNION_PROC),
+ CurrentMemoryContext);
+ fmgr_info_copy(&(giststate->compressFn[i]),
+ index_getprocinfo(index, i+1, GIST_COMPRESS_PROC),
+ CurrentMemoryContext);
+ fmgr_info_copy(&(giststate->decompressFn[i]),
+ index_getprocinfo(index, i+1, GIST_DECOMPRESS_PROC),
+ CurrentMemoryContext);
+ fmgr_info_copy(&(giststate->penaltyFn[i]),
+ index_getprocinfo(index, i+1, GIST_PENALTY_PROC),
+ CurrentMemoryContext);
+ fmgr_info_copy(&(giststate->picksplitFn[i]),
+ index_getprocinfo(index, i+1, GIST_PICKSPLIT_PROC),
+ CurrentMemoryContext);
+ fmgr_info_copy(&(giststate->equalFn[i]),
+ index_getprocinfo(index, i+1, GIST_EQUAL_PROC),
+ CurrentMemoryContext);
}
}