Re: Reducing opr_sanity test's runtime under CLOBBER_CACHE_ALWAYS
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2021-05-10T20:17:18Z
Lists: pgsql-hackers
Attachments
- save-work-for-empty-data-structures-1.patch (text/x-diff) patch
Andres Freund <andres@anarazel.de> writes: > On 2021-05-10 14:06:16 -0400, Tom Lane wrote: >> 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. > We could make the hashtables shrink, not just grow... I noticed that we already have counters that can tell whether a catcache or dynahash table is empty, so I experimented with the attached patch. Testing one of the slow queries from privileges.sql (which might not be very representative of the overall issue), I see: HEAD: Time: 536429.715 ms (08:56.430) with ResetCatalogCache hack: Time: 488938.597 ms (08:08.939) plus hash_seq_search hack: Time: 475400.634 ms (07:55.401) Of course, the issue with these patches is that they change these counters from things that (I think) we only trust for statistical purposes into things that had better be right or you're going to have impossible-to-track-down bugs with sometimes failing to invalidate cache entries. My gut feeling is that the risk-to-reward ratio is worth it for changing ResetCatalogCache, but not for hash_seq_search. This is partly because of the greater absolute payback and partly because ResetCatalogCache doesn't deal with shared data structures, reducing the risk of counting issues. regards, tom lane
Commits
-
Replace opr_sanity test's binary_coercible() function with C code.
- 6303a5730914 14.0 landed
-
Clean up/tighten up coercibility checks in opr_sanity regression test.
- e9f42d529f99 12.0 cited