Re: Clock sweep not caching enough B-Tree leaf pages? - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Clock sweep not caching enough B-Tree leaf pages?
Date
Msg-id CAM3SWZS9u+9DcFmb4FQ-ierB9BC-XJ2BspqsearC8uVZhGMBuw@mail.gmail.com
Whole thread Raw
In response to Re: Clock sweep not caching enough B-Tree leaf pages?  (Jason Petersen <jason@citusdata.com>)
List pgsql-hackers
On Fri, Apr 18, 2014 at 1:11 PM, Jason Petersen <jason@citusdata.com> wrote:
> Yes, we obviously want a virtual clock. Focusing on the use of gettimeofday
> seems silly to me: it was something quick for the prototype.

The gettimeofday() call doesn't need to happen in a tight loop. It can
be reasonably passed down from higher up, very probably without
consequence. The LRU-K paper actually recommends a delay of 5 seconds.
There is at least one other major database system that unambiguously
uses a wall-clock delay of 3 seconds (by default) for this exact
purpose - avoiding what the LRU-K paper calls "correlated references".

I'm not saying that we should go with that particular scheme for these
reasons. However, it's plainly untrue that using wall time like this
represents some kind of insurmountable scalability obstacle.

> The problem with the clocksweeps is they don’t actually track the
> progression of “time” within the PostgreSQL system.
>
> What’s wrong with using a transaction number or some similar sequence? It
> would accurately track “age” in the sense we care about: how long ago in
> “units of real work being done by the DB” something was added.

The LRU-K paper suggests that a scheme like this could be preferable.
I have my doubts that it can be made to work with Postgres.

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Atri Sharma
Date:
Subject: Re: Clock sweep not caching enough B-Tree leaf pages?
Next
From: Bruce Momjian
Date:
Subject: Re: Clock sweep not caching enough B-Tree leaf pages?