Re: Add usage counts to pg_buffercache - Mailing list pgsql-patches

From Greg Smith
Subject Re: Add usage counts to pg_buffercache
Date
Msg-id Pine.GSO.4.64.0703312259530.3580@westnet.com
Whole thread Raw
In response to Re: Add usage counts to pg_buffercache  (Russell Smith <mr-russ@pws.com.au>)
List pgsql-patches
On Sun, 1 Apr 2007, Russell Smith wrote:

> Currently the max buffer count is 5. But is that a complete safe
> assumption?  Maybe a compile time check that BM_MAX_USAGE_COUNT is < 16k
> would ensure that things don't go wrong?

I actually wasn't even aware that was a hard limit; I just assumed that
all my systems just never got over 5 before the LRU hit them.  How 'bout
that.

I'm all for paranoia, but the idea of letting LRU usage counts go over 16
bits seems pretty unlikely with the current approach.  That would mean
those pages would need 64K passes over the buffer cache before they could
get evicted, which would take quite a while.  My bet is that bufferid gets
expanded from 32 bits before that happens, which would break
pg_buffercache similarly and isn't being checked for either.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

pgsql-patches by date:

Previous
From: Russell Smith
Date:
Subject: Re: Add usage counts to pg_buffercache
Next
From: Tom Lane
Date:
Subject: Re: Current enums patch