Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cS2Ol-0002EW-MO for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2017 14:00:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cS2Ol-00062f-63 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2017 14:00:07 +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_2) (envelope-from ) id 1cS2NL-0004TF-O4 for pgsql-hackers@postgresql.org; Fri, 13 Jan 2017 13:58:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cS2NI-0007l1-0Q for pgsql-hackers@postgresql.org; Fri, 13 Jan 2017 13:58:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v0DDwVh6004648; Fri, 13 Jan 2017 08:58:31 -0500 From: Tom Lane To: Michael Paquier cc: Robert Haas , Craig Ringer , Kyotaro HORIGUCHI , "pgsql-hackers@postgresql.org" Subject: Re: Protect syscache from bloating with negative cache entries In-reply-to: References: <20161219.201505.11562604.horiguchi.kyotaro@lab.ntt.co.jp> <30868.1482246558@sss.pgh.pa.us> <23492.1482264621@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Fri, 13 Jan 2017 16:59:26 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4646.1484315911.1@sss.pgh.pa.us> Date: Fri, 13 Jan 2017 08:58:31 -0500 Message-ID: <4647.1484315911@sss.pgh.pa.us> X-Pg-Spam-Score: -5.1 (-----) 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 Michael Paquier writes: > Have there been ever discussions about having catcache entries in a > shared memory area? This does not sound much performance-wise, I am > just wondering about the concept and I cannot find references to such > discussions. I'm sure it's been discussed. Offhand I remember the following issues: * A shared cache would create locking and contention overhead. * A shared cache would have a very hard size limit, at least if it's in SysV-style shared memory (perhaps DSM would let us relax that). * Transactions that are doing DDL have a requirement for the catcache to reflect changes that they've made locally but not yet committed, so said changes mustn't be visible globally. You could possibly get around the third point with a local catcache that's searched before the shared one, but tuning that to be performant sounds like a mess. Also, I'm not sure how such a structure could cope with uncommitted deletions: delete A -> remove A from local catcache, but not the shared one -> search for A in local catcache -> not found -> search for A in shared catcache -> found -> oops. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers