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

From: Jan Wieck <jan(at)wi3ck(dot)info>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <kgrittn(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references.
Date: 2015-09-15 16:02:26
Message-ID: 55F84112.8020307@wi3ck.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 09/15/2015 11:54 AM, Tom Lane wrote:
> Jan Wieck <jan(at)wi3ck(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2015-09-15 19:20:45 pgsql: Fix whitespace
Previous Message Tom Lane 2015-09-15 15:54:34 Re: [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-09-15 16:10:43 Re: row_security GUC, BYPASSRLS
Previous Message Robert Haas 2015-09-15 15:58:00 Re: row_security GUC, BYPASSRLS