Re: SearchCatCacheList()/SearchSysCacheList() is O(n)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SearchCatCacheList()/SearchSysCacheList() is O(n)
Date: 2021-05-12 21:49:25
Message-ID: 1350974.1620856165@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-05-12 22:01:21 Re: Do we need to rethink how to parallelize regression tests to speedup CLOBBER_CACHE_ALWAYS?
Previous Message Andres Freund 2021-05-12 21:37:43 Re: SearchCatCacheList()/SearchSysCacheList() is O(n)