From: Greg Smith <greg@2ndquadrant.com>
To: Mark Rostron <mrostron@ql2.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: questions regarding shared_buffers behavior
Date: Sun, 07 Nov 2010 18:30:14 -0500
Message-ID: <4CD73686.4090807@2ndquadrant.com> (raw)
In-Reply-To: <FD020D3E50E7FA479567872E5F5F31E3045A218A28@ex01.corp.ql2.com>
References: <FD020D3E50E7FA479567872E5F5F31E3045A218A28@ex01.corp.ql2.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: greg@2ndquadrant.com, mrostron@ql2.com
Subject: Re: questions regarding shared_buffers behavior
In-Reply-To: <4CD73686.4090807@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox