Re: SearchCatCacheList()/SearchSysCacheList() is O(n) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SearchCatCacheList()/SearchSysCacheList() is O(n)
Date
Msg-id 1350974.1620856165@sss.pgh.pa.us
Whole thread Raw
In response to Re: SearchCatCacheList()/SearchSysCacheList() is O(n)  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> It's not an individual "result" list that's the issue. In my example
> they're all exactly one element long. The problem is that CatCache->list
> has one element for each cached SearchCatCacheList() result, and that
> for every SearchCatCacheList() we linearly search through CatCache->list
> to find a match.

Ah, now I understand.  Yeah, replacing that list with a hash table might
be a good idea.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: SearchCatCacheList()/SearchSysCacheList() is O(n)
Next
From: David Rowley
Date:
Subject: Re: Do we need to rethink how to parallelize regression tests to speedup CLOBBER_CACHE_ALWAYS?