pgsql: Optimize InvalidateAttoptCacheCallback() and TypeCacheTypCallbac - Mailing list pgsql-committers

From Alexander Korotkov
Subject pgsql: Optimize InvalidateAttoptCacheCallback() and TypeCacheTypCallbac
Date
Msg-id E1sbXy7-00340M-1R@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Optimize InvalidateAttoptCacheCallback() and TypeCacheTypCallback()

These callbacks are receiving hash values as arguments, which doesn't allow
direct lookups for AttoptCacheHash and TypeCacheHash.  This is why subject
callbacks currently use full iteration over corresponding hashes.

This commit avoids full hash iteration in InvalidateAttoptCacheCallback(),
and TypeCacheTypCallback().  At first, we switch AttoptCacheHash and
TypeCacheHash to use same hash function as syscache.  As second, we
use hash_seq_init_with_hash_value() to iterate only hash entries with matching
hash value.

Discussion: https://postgr.es/m/5812a6e5-68ae-4d84-9d85-b443176966a1%40sigaev.ru
Author: Teodor Sigaev
Reviewed-by: Aleksander Alekseev, Tom Lane, Michael Paquier, Roman Zharkov
Reviewed-by: Andrei Lepikhov

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/40064a8ee1b34d8a128d6007416acd89077a2c11

Modified Files
--------------
src/backend/utils/cache/attoptcache.c | 39 +++++++++++++++++++++----
src/backend/utils/cache/typcache.c    | 55 +++++++++++++++++++++++++----------
2 files changed, 73 insertions(+), 21 deletions(-)


pgsql-committers by date:

Previous
From: noreply@postgresql.org
Date:
Subject: pgsql: Tag refs/tags/REL_16_4 was created
Next
From: Pavel Stehule
Date:
Subject: Re: pgsql: Introduce hash_search_with_hash_value() function