Search Postgresql Archives

Re: pg_buffercache's usage count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ben Chobot wrote:
On Feb 23, 2010, at 3:06 PM, Ben Chobot wrote:

I'm looking at the usage count column of pg_buffercache's info, and I'm confused. Several buffers that supposed have LRU values of 5 belong to non-unique indices which supposedly have never been used. As I understand things, that shouldn't happen. Am I missing something?

(And maybe more to the point, when does the LRU go down in value?)

Usage counts only go up when a page is "pinned" because some backend requested that particular block for its work via a call to BufferAlloc with the file/block it needs. Usage counts go down every time the clock sweep hand looking to allocate new buffers passes over that page during its constant circular scanning of the buffer cache. The mechanics involved are described in a pretty detailed way by the "Inside the PostgreSQL Buffer Cache" presentation at http://www.westnet.com/~gsmith/content/postgresql/ (and no where else I'm aware of, besides the source code itself).

--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
greg@xxxxxxxxxxxxxxx   www.2ndQuadrant.us


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux