postgresql/src/backend/utils/cache
Alexander Korotkov 40064a8ee1 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
2024-08-07 07:06:17 +03:00
..
attoptcache.c Optimize InvalidateAttoptCacheCallback() and TypeCacheTypCallback() 2024-08-07 07:06:17 +03:00
catcache.c Cope with inplace update making catcache stale during TOAST fetch. 2024-06-27 19:21:06 -07:00
evtcache.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
inval.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
lsyscache.c ATTACH PARTITION: Don't match a PK with a UNIQUE constraint 2024-04-15 15:07:47 +02:00
Makefile Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
partcache.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
plancache.c Separate equalRowTypes() from equalTupleDescs() 2024-03-17 05:58:04 +01:00
relcache.c Remove useless initializations 2024-07-01 08:50:10 +02:00
relfilenumbermap.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
relmapper.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
spccache.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
syscache.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
ts_cache.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
typcache.c Optimize InvalidateAttoptCacheCallback() and TypeCacheTypCallback() 2024-08-07 07:06:17 +03:00