mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.19 2001/06/01 02:41:35 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/scankey.c,v 1.20 2001/10/06 23:21:43 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -69,3 +69,31 @@ ScanKeyEntryInitialize(ScanKey entry,
|
||||
|
||||
Assert(ScanKeyEntryIsLegal(entry));
|
||||
}
|
||||
|
||||
/*
|
||||
* ScanKeyEntryInitializeWithInfo
|
||||
* Initializes a scan key entry using an already-completed FmgrInfo
|
||||
* function lookup record.
|
||||
*
|
||||
* mcxt is the memory context holding the scan key; it'll be used for
|
||||
* any subsidiary info attached to the scankey's FmgrInfo record.
|
||||
*/
|
||||
void
|
||||
ScanKeyEntryInitializeWithInfo(ScanKey entry,
|
||||
bits16 flags,
|
||||
AttrNumber attributeNumber,
|
||||
FmgrInfo *finfo,
|
||||
MemoryContext mcxt,
|
||||
Datum argument)
|
||||
{
|
||||
Assert(PointerIsValid(entry));
|
||||
Assert(RegProcedureIsValid(finfo->fn_oid));
|
||||
|
||||
entry->sk_flags = flags;
|
||||
entry->sk_attno = attributeNumber;
|
||||
entry->sk_procedure = finfo->fn_oid;
|
||||
entry->sk_argument = argument;
|
||||
fmgr_info_copy(&entry->sk_func, finfo, mcxt);
|
||||
|
||||
Assert(ScanKeyEntryIsLegal(entry));
|
||||
}
|
||||
|
Reference in New Issue
Block a user