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/include/fmgr.h | |
| 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/include/fmgr.h')
| -rw-r--r-- | src/include/fmgr.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/include/fmgr.h b/src/include/fmgr.h index 44641bdcb1..0acb966f68 100644 --- a/src/include/fmgr.h +++ b/src/include/fmgr.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: fmgr.h,v 1.14 2001/05/17 17:44:18 petere Exp $ + * $Id: fmgr.h,v 1.15 2001/10/06 23:21:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,7 +35,7 @@ typedef Datum (*PGFunction) (FunctionCallInfo fcinfo); * to be called multiple times, the lookup need be done only once and the * info struct saved for re-use. */ -typedef struct +typedef struct FmgrInfo { PGFunction fn_addr; /* pointer to function or handler to be * called */ @@ -73,6 +73,20 @@ typedef struct FunctionCallInfoData extern void fmgr_info(Oid functionId, FmgrInfo *finfo); /* + * Same, when the FmgrInfo struct is in a memory context longer-lived than + * CurrentMemoryContext. The specified context will be set as fn_mcxt + * and used to hold all subsidiary data of finfo. + */ +extern void fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, + MemoryContext mcxt); + +/* + * Copy an FmgrInfo struct + */ +extern void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo, + MemoryContext destcxt); + +/* * This macro invokes a function given a filled-in FunctionCallInfoData * struct. The macro result is the returned Datum --- but note that * caller must still check fcinfo->isnull! Also, if function is strict, @@ -341,16 +355,18 @@ extern Datum OidFunctionCall9(Oid functionId, Datum arg1, Datum arg2, /* * Routines in fmgr.c */ -extern Pg_finfo_record *fetch_finfo_record(char *filename, char *funcname); +extern Pg_finfo_record *fetch_finfo_record(void *filehandle, char *funcname); extern Oid fmgr_internal_function(const char *proname); /* * Routines in dfmgr.c */ +extern char * Dynamic_library_path; + extern PGFunction load_external_function(char *filename, char *funcname, - bool signalNotFound); + bool signalNotFound, void **filehandle); +extern PGFunction lookup_external_function(void *filehandle, char *funcname); extern void load_file(char *filename); -extern char * Dynamic_library_path; /* |
