From a1cab2e2a87f34dd996def3ee8f1fbfb39d5b1ab Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 13 Aug 2025 20:00:30 +0900 Subject: [PATCH v10 08/14] Add catcache support for OID8OID This is required to be able to do catalog cache lookups of oid8 fields for toast values of the same type. --- src/backend/utils/cache/catcache.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 9cfda91a877c..5ffe1e38b326 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -240,6 +240,18 @@ int4hashfast(Datum datum) return murmurhash32((int32) DatumGetInt32(datum)); } +static bool +oid8eqfast(Datum a, Datum b) +{ + return DatumGetObjectId8(a) == DatumGetObjectId8(b); +} + +static uint32 +oid8hashfast(Datum datum) +{ + return murmurhash64(DatumGetObjectId8(datum)); +} + static bool texteqfast(Datum a, Datum b) { @@ -300,6 +312,11 @@ GetCCHashEqFuncs(Oid keytype, CCHashFN *hashfunc, RegProcedure *eqfunc, CCFastEq *fasteqfunc = int4eqfast; *eqfunc = F_INT4EQ; break; + case OID8OID: + *hashfunc = oid8hashfast; + *fasteqfunc = oid8eqfast; + *eqfunc = F_OID8EQ; + break; case TEXTOID: *hashfunc = texthashfast; *fasteqfunc = texteqfast; -- 2.51.0