Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zbsgq-0004YQ-OD for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2015 16:02:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zbsgq-0002ml-2j for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2015 16:02:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zbsgo-0002m0-Om for pgsql-hackers@postgresql.org; Tue, 15 Sep 2015 16:02:38 +0000 Received: from mail-qg0-f43.google.com ([209.85.192.43]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Zbsgg-0006oI-SA for pgsql-hackers@postgresql.org; Tue, 15 Sep 2015 16:02:37 +0000 Received: by qgx61 with SMTP id 61so147017496qgx.3 for ; Tue, 15 Sep 2015 09:02:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=PzMa1KGNBDU0Nx7i3NVbpxgii3fEsM9U0lr3p3Za42g=; b=MeNUMHzf29qquGBHCMvvP5OveWy9HGX91AT1idmM9+VeLbJHbC7KhUdPn3zMkoog5o zamc28sUI38a/aJqlXWQUJmmNAGiDeeTKw6IL5cEMUJ+uOQbtipRz428o5R8hoaHtUOQ Hy19zL4LOfzBPyAOuV+EItGoq7NgaXW80OjwMyI0vSArpUb3oKrqVxzMnwwqdDU4XGnw Io5Dr2UKtlxa04Pk74xTiA8T9qq9ubSEFQIn8IAj+ZF1DthVXx7SioMGpeZiFeJynof9 nVGlKIJBJU1dXaSuKOxtWLZ8ZhV/mSRWOsYnUOwFKIxdkAGhPAIkVCMTw60CmDqXez5Z ynFw== X-Gm-Message-State: ALoCoQlCHC6wqJnJH0+Kwb6gwm6WjQOtoTa3bkbVQs4jpBlyF2lriwBdNpystNMzyz57wmUxz7Ls X-Received: by 10.140.20.168 with SMTP id 37mr11746156qgj.16.1442332947941; Tue, 15 Sep 2015 09:02:27 -0700 (PDT) Received: from jupiter.onmars.janwieck.no-ip.info (pool-173-49-130-135.phlapa.fios.verizon.net. [173.49.130.135]) by smtp.googlemail.com with ESMTPSA id b73sm8230732qka.14.2015.09.15.09.02.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 09:02:27 -0700 (PDT) Message-ID: <55F84112.8020307@wi3ck.info> Date: Tue, 15 Sep 2015 12:02:26 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Tom Lane CC: Kevin Grittner , pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Fix an O(N^2) problem in foreign key references. References: <10758.1442239007@sss.pgh.pa.us> <55F81C48.4020009@wi3ck.info> <22834.1442325108@sss.pgh.pa.us> <1935.1442329129@sss.pgh.pa.us> <55F83ABF.2080609@wi3ck.info> <4716.1442332474@sss.pgh.pa.us> In-Reply-To: <4716.1442332474@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 09/15/2015 11:54 AM, Tom Lane wrote: > Jan Wieck 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers