Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKtPM-0003Pk-EO for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Dec 2017 22:03:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKtPL-0005ly-BN for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Dec 2017 22:03:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eKtPL-0005lo-5D for pgsql-hackers@lists.postgresql.org; Fri, 01 Dec 2017 22:03:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eKtPI-0008Ui-3v for pgsql-hackers@postgresql.org; Fri, 01 Dec 2017 22:03:42 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vB1M3SKa018897; Fri, 1 Dec 2017 17:03:28 -0500 From: Tom Lane To: Andres Freund cc: Robert Haas , Michael Paquier , Kyotaro HORIGUCHI , David Steele , Jim Nasby , Craig Ringer , PostgreSQL mailing lists Subject: Re: Protect syscache from bloating with negative cache entries In-reply-to: <20171201214534.dfp2sd427puislll@alap3.anarazel.de> References: <20171031.184622.92520047.horiguchi.kyotaro@lab.ntt.co.jp> <84820.1512015443@sss.pgh.pa.us> <85587.1512101829@sss.pgh.pa.us> <20171201213113.z4gbol66ipvg5b4o@alap3.anarazel.de> <3544.1512164423@sss.pgh.pa.us> <20171201214534.dfp2sd427puislll@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 01 Dec 2017 13:45:34 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3597.1512165808.1@sss.pgh.pa.us> Date: Fri, 01 Dec 2017 17:03:28 -0500 Message-ID: <3598.1512165808@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2017-12-01 16:40:23 -0500, Tom Lane wrote: >> I have no faith in either of these proposals, because they both assume >> that the problem only arises over the course of many minutes. In the >> recent complaint about pg_dump causing relcache bloat, it probably does >> not take nearly that long for the bloat to occur. > To me that's a bit of a different problem than what I was discussing > here. It also actually doesn't seem that hard - if your caches are > growing fast, you'll continually get hash-resizing of the > various. Adding cache-pruning to the resizing code doesn't seem hard, > and wouldn't add meaningful overhead. That's an interesting way to think about it, as well, though I'm not sure it's quite that simple. If you tie this to cache resizing then the cache will have to grow up to the newly increased size before you'll prune it again. That doesn't sound like it will lead to nice steady-state behavior. regards, tom lane