Re: Protect syscache from bloating with negative cache entries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, David Steele <david(at)pgmasters(dot)net>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Protect syscache from bloating with negative cache entries
Date: 2017-12-01 22:03:28
Message-ID: 3598.1512165808@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-12-01 22:10:27 Re: [HACKERS] Proposal: Local indexes for partitioned table
Previous Message Tom Lane 2017-12-01 21:59:25 Re: [HACKERS] proposal: psql command \graw