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

From Tom Lane
Subject Re: SearchCatCacheList()/SearchSysCacheList() is O(n)
Date
Msg-id 1343982.1620854788@sss.pgh.pa.us
Whole thread Raw
In response to SearchCatCacheList()/SearchSysCacheList() is O(n)  (Andres Freund <andres@anarazel.de>)
Responses Re: SearchCatCacheList()/SearchSysCacheList() is O(n)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> The problem is that SearchCatCacheList() is not actually a hash table -
> there are no buckets, in contrast to SearchCatCacheList().

Uh, what did you mean to compare to there?

> Tom, any chance you remember if this was an oversight, or whether you
> just considered this to be OK, given the likely numbers of objects?

I'm pretty sure I didn't think the lists would get large enough to be
a problem.  I'm not quite sure which list is a problem here, actually,
seeing that the functions all have distinct names.

I have a vague recollection that some callers depend on the lists
being ordered by key.  I'm also fairly sure that most callers need
to look at all entries of whichever list they've requested.  So
I have doubts that "use a hash table" is really going to be a
productive idea.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: SearchCatCacheList()/SearchSysCacheList() is O(n)
Next
From: Andres Freund
Date:
Subject: Re: SearchCatCacheList()/SearchSysCacheList() is O(n)