pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Cc: Andres Freund <andres@anarazel.de>
Cc: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Ideriha, Takeshi <ideriha.takeshi@jp.fujitsu.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: David Steele <david@pgmasters.net>
Cc: Craig Ringer <craig@2ndquadrant.com>
Subject: Re: Protect syscache from bloating with negative cache entries
Date: Thu, 07 Mar 2019 09:52:30 -0500
Message-ID: <8900.1551970350@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoYyWpw=K6zm1pncwd2jKWU6QifepM9pot1yfZBpYrPz6g@mail.gmail.com>
References: <CA+TgmoZXw+SwK_9Tp=wLqZDstW_X+Ant=rd7K+q4zmYONPuL=w@mail.gmail.com>
	<20190225.152653.211323929.horiguchi.kyotaro@lab.ntt.co.jp>
	<CA+Tgmoa2b-LUF9h3wugD9ZA5MP0xyu2kJYHC9L6sdLywNSmhBQ@mail.gmail.com>
	<20190301.173245.25820912.horiguchi.kyotaro@lab.ntt.co.jp>
	<CA+TgmobXDWanVtVjLpayQnWfyTd49ma4j1q71ek_Ce=Z9A2UBg@mail.gmail.com>
	<1752.1551903431@sss.pgh.pa.us>
	<b950e760-8ea3-f2f4-4826-c7c50f6a16e6@2ndquadrant.com>
	<CA+TgmoYyWpw=K6zm1pncwd2jKWU6QifepM9pot1yfZBpYrPz6g@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Mar 6, 2019 at 6:18 PM Tomas Vondra
> <tomas.vondra@2ndquadrant.com> wrote:
>> Which part of the LRU approach is supposedly expensive? Updating the
>> lastaccess field or moving the entries to tail? I'd guess it's the
>> latter, so perhaps we can keep some sort of age field, update it less
>> frequently (once per minute?), and do the clock sweep?

> Move to tail (although lastaccess would be expensive if too if it
> involves an extra gettimeofday() call).

As I recall, the big problem with the old LRU code was loss of
locality of access, in that in addition to the data associated with
hot syscache entries, you were necessarily also touching list link
fields associated with not-hot entries.  That's bad for the CPU cache.

A gettimeofday call (or any other kernel call) per syscache access
would be a complete disaster.

			regards, tom lane




view thread (272+ messages)  latest in thread

Message-ID: <8900.1551970350@sss.pgh.pa.us>
Permalink:  ../8900.1551970350@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8900.1551970350@sss.pgh.pa.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: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, tomas.vondra@2ndquadrant.com, horiguchi.kyotaro@lab.ntt.co.jp, andres@anarazel.de, tsunakawa.takay@jp.fujitsu.com, alvherre@2ndquadrant.com, bruce@momjian.us, ideriha.takeshi@jp.fujitsu.com, pgsql-hackers@lists.postgresql.org, michael.paquier@gmail.com, david@pgmasters.net, craig@2ndquadrant.com
  Subject: Re: Protect syscache from bloating with negative cache entries
  In-Reply-To: <8900.1551970350@sss.pgh.pa.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