mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Avoid looping over all type cache entries in TypeCacheRelCallback()
Currently when a single relcache entry gets invalidated, TypeCacheRelCallback() has to loop over all type cache entries to find appropriate typentry to invalidate. Unfortunately, using the syscache here is impossible, because this callback could be called outside a transaction and this makes impossible catalog lookups. This is why present commit introduces RelIdToTypeIdCacheHash to map relation OID to its composite type OID. We are keeping RelIdToTypeIdCacheHash entry while corresponding type cache entry have something to clean. Therefore, RelIdToTypeIdCacheHash shouldn't get bloat in the case of temporary tables flood. 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, Pavel Borisov
This commit is contained in:
@@ -2377,6 +2377,7 @@ RelFileLocator
|
||||
RelFileLocatorBackend
|
||||
RelFileNumber
|
||||
RelIdCacheEnt
|
||||
RelIdToTypeIdCacheEntry
|
||||
RelInfo
|
||||
RelInfoArr
|
||||
RelMapFile
|
||||
|
||||
Reference in New Issue
Block a user