Hello, I read and tested only the first patch so far. Creation of temp tables and rollback in your script work 3-4 times faster with 0001-type-cache.patch on my windows laptop.
In the patch I found a copy of the comment "If it's domain over composite, reset flags...". Can we move the reset flags operation and its comment into the invalidateCompositeTypeCacheEntry() function? This simplify the TypeCacheRelCallback() func, but adds two more IF statements when we need to clean up a cache entry for a specific relation. (diff attached). -- Roman Zharkov