pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
Cc: andres@anarazel.de <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: Ideriha, Takeshi <ideriha.takeshi@jp.fujitsu.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Cc: alvherre@alvh.no-ip.org <alvherre@alvh.no-ip.org>
Cc: michael.paquier@gmail.com <michael.paquier@gmail.com>
Cc: david@pgmasters.net <david@pgmasters.net>
Cc: craig@2ndquadrant.com <craig@2ndquadrant.com>
Subject: Re: Protect syscache from bloating with negative cache entries
Date: Wed, 13 Feb 2019 15:24:02 -0500
Message-ID: <20190213202402.GA6933@momjian.us> (raw)
In-Reply-To: <9ebe0ac4-b59e-6397-0586-4e7125de7d5b@2ndquadrant.com>
References: <1391.1547845037@sss.pgh.pa.us>
	<20190118212330.t5ibohxlavuy55bg@alap3.anarazel.de>
	<CA+TgmoY_2MYoLm_qyYPJ3xDMzTVe+Er33F=gXkXxpiHHfgxUDA@mail.gmail.com>
	<20190119010941.6ruftewah7t3k3yk@alap3.anarazel.de>
	<20190121205624.GB1060@momjian.us>
	<0d3806bf-5087-a75f-3592-ee1d508a79db@2ndquadrant.com>
	<B326B25F2E3A4EEABE8D8363D4E37828@tunaPC>
	<883b2580-027e-4cb4-fb21-679c14fdb50a@2ndquadrant.com>
	<0A3221C70F24FB45833433255569204D1FB9723F@G01JPEXMBYT05>
	<9ebe0ac4-b59e-6397-0586-4e7125de7d5b@2ndquadrant.com>

On Tue, Feb 12, 2019 at 02:53:40AM +0100, Tomas Vondra wrote:
> Right. But the logic behind time-based approach is that evicting such
> entries should not cause any issues exactly because they are accessed
> infrequently. It might incur some latency when we need them for the
> first time after the eviction, but IMHO that's acceptable (although I
> see Andres did not like that).
> 
> FWIW we might even evict entries after some time passes since inserting
> them into the cache - that's what memcached et al do, IIRC. The logic is
> that frequently accessed entries will get immediately loaded back (thus
> keeping cache hit ratio high). But there are reasons why the other dbs
> do that - like not having any cache invalidation (unlike us).

Agreed.  If this fixes 90% of the issues people will have, and it
applies to the 99.9% of users who will never tune this, it is a clear
win.  If we want to add something that requires tuning later, we can
consider it once the non-tuning solution is done.

> That being said, having a "minimal size" threshold before starting with
> the time-based eviction may be a good idea.

Agreed.  I see the minimal size as a way to keep the systems tables in
cache, which we know we will need for the next query.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +




view thread (272+ messages)  latest in thread

Message-ID: <20190213202402.GA6933@momjian.us>
Permalink:  ../20190213202402.GA6933@momjian.us/
Also on:    postgresql.org/message-id/20190213202402.GA6933@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: bruce@momjian.us, tomas.vondra@2ndquadrant.com, tsunakawa.takay@jp.fujitsu.com, andres@anarazel.de, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, horiguchi.kyotaro@lab.ntt.co.jp, ideriha.takeshi@jp.fujitsu.com, pgsql-hackers@lists.postgresql.org, alvherre@alvh.no-ip.org, michael.paquier@gmail.com, david@pgmasters.net, craig@2ndquadrant.com
  Subject: Re: Protect syscache from bloating with negative cache entries
  In-Reply-To: <20190213202402.GA6933@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox