Re: Clock sweep not caching enough B-Tree leaf pages?

Jason Petersen <jason@citusdata.com>

From: Jason Petersen <jason@citusdata.com>
To: Atri Sharma <atri.jiit@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>, Peter Geoghegan <pg@heroku.com>, Greg Stark <stark@mit.edu>, Ants Aasma <ants@cybertec.at>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2014-04-18T20:11:04Z
Lists: pgsql-hackers
On Apr 18, 2014, at 1:51 PM, Atri Sharma <atri.jiit@gmail.com> wrote:

> Counting clock sweeps is an intersting idea.  I think one concern was
> tracking hot buffers in cases where there is no memory pressure, and
> hence the clock sweep isn't running --- I am not sure how this would
> help in that case.
> 


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 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.

—Jason

Commits

  1. Replace the BufMgrLock with separate locks on the lookup hashtable and