Re: [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references. - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references.
Date
Msg-id 55F84112.8020307@wi3ck.info
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references.
List pgsql-hackers
On 09/15/2015 11:54 AM, Tom Lane wrote:
> Jan Wieck <jan@wi3ck.info> writes:
>> Would it be appropriate to use (Un)RegisterXactCallback() in case of
>> detecting excessive sequential scanning of that cache and remove all
>> invalid entries from it at that time?

> Another idea is that it's not the size of the cache that's the problem,
> it's the cost of finding the entries that need to be invalidated.
> So we could also consider adding list links that chain only the entries
> that are currently marked valid.  If the list gets too long, we could mark
> them all invalid and thereby reset the list to nil.  This doesn't do
> anything for the cache's space consumption, but that wasn't what you were
> worried about anyway was it?

That sounds like a workable solution to this edge case. I'll see how 
that works.


Thanks, Jan

-- 
Jan Wieck
Senior Software Engineer
http://slony.info



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: row_security GUC, BYPASSRLS
Next
From: Tom Lane
Date:
Subject: Re: row_security GUC, BYPASSRLS