Re: questions regarding shared_buffers behavior - Mailing list pgsql-performance

From Greg Smith
Subject Re: questions regarding shared_buffers behavior
Date
Msg-id 4CD73686.4090807@2ndquadrant.com
Whole thread Raw
In response to questions regarding shared_buffers behavior  (Mark Rostron <mrostron@ql2.com>)
Responses Re: questions regarding shared_buffers behavior
List pgsql-performance
Mark Rostron wrote:
>
> What is the procedure that postgres uses to decide whether or not a
> table/index block will be left in the shared_buffers cache at the end
> of the operation?
>

There is no such procedure.  When a table or index page is used, its
usage count goes up, which means it's more likely to stay in the cache
for longer afterwards.  Processing trying to allocate pages are
constantly circling the buffer cache looking for pages where the usage
count is at 0 to re-use.  The only special cases are for sequential
scans and VACUUM, which use continuously re-use a small section of the
buffer cache in some cases instead.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services and Support        www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


pgsql-performance by date:

Previous
From: Mark Rostron
Date:
Subject: questions regarding shared_buffers behavior
Next
From: Greg Smith
Date:
Subject: Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?