Andres Freund <and...@anarazel.de> writes: > On 2021-05-08 15:44:57 -0400, Tom Lane wrote: >> I was able to complete a bisection using just that test, and >> got an unexpected result: most of the slowdown appeared at >> ab596105b (BRIN minmax-multi indexes). Apparently the additional >> time is simply from having to check the additional pg_amop and >> pg_amproc entries, which that patch added quite a few of.
> I suspect that it might be not just that. From a quick profile it looks > like debug_invalidate_system_caches_always spends a good chunk of its > time in ResetCatalogCache() and hash_seq_search(). Those cost linearly > with the size of the underlying hash tables. > Wo what what might be happening is that the additional catalog entries > pushed some of the catcache hash tables into growing > (RehashCatCache()). Which then makes all subsequent ResetCatalogCache() > scans slower. Hm. But constantly flushing the caches should mean that they're never populated with very many entries at one time, which ought to forestall that, at least to some extent. I wonder if there's anything we could do to make ResetCatalogCache faster? It wouldn't help much for normal execution of course, but it might do something to bring CCA testing time down out of the stratosphere. regards, tom lane