mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Revise sinval code to remove no-longer-used tuple TID from inval messages.
This requires adjusting the API for syscache callback functions: they now get a hash value, not a TID, to identify the target tuple. Most of them weren't paying any attention to that argument anyway, but plancache did require a small amount of fixing. Also, improve performance a trifle by avoiding sending duplicate inval messages when a heap_update isn't changing the catcache lookup columns.
This commit is contained in:
@@ -36,7 +36,7 @@ static Oid last_roleid = InvalidOid; /* InvalidOid == cache not valid */
|
||||
static bool last_roleid_is_super = false;
|
||||
static bool roleid_callback_registered = false;
|
||||
|
||||
static void RoleidCallback(Datum arg, int cacheid, ItemPointer tuplePtr);
|
||||
static void RoleidCallback(Datum arg, int cacheid, uint32 hashvalue);
|
||||
|
||||
|
||||
/*
|
||||
@@ -96,11 +96,11 @@ superuser_arg(Oid roleid)
|
||||
}
|
||||
|
||||
/*
|
||||
* UseridCallback
|
||||
* RoleidCallback
|
||||
* Syscache inval callback function
|
||||
*/
|
||||
static void
|
||||
RoleidCallback(Datum arg, int cacheid, ItemPointer tuplePtr)
|
||||
RoleidCallback(Datum arg, int cacheid, uint32 hashvalue)
|
||||
{
|
||||
/* Invalidate our local cache in case role's superuserness changed */
|
||||
last_roleid = InvalidOid;
|
||||
|
Reference in New Issue
Block a user