From: James Rogers <jamesr@best.com>
To: Andrew Sullivan <andrew@libertyrms.info>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Seqscan buffer promotion (was: reindex/vacuum locking/performance?)
Date: 06 Oct 2003 09:55:38 -0700
Message-ID: <1065459338.26229.26.camel@localhost.localdomain> (raw)
In-Reply-To: <20031006121459.GC4971@libertyrms.info>
References: <1065397835.471.17.camel@tokyo>
<Pine.BSF.4.44.0310060757330.52159-100000@torgo.978.org>
<20031006121459.GC4971@libertyrms.info>
On Mon, 2003-10-06 at 05:15, Andrew Sullivan wrote:
> There's plenty of academic work which purports to show that LRU is
> far from the best choice. Just in principle, it seems obvious that a
> single-case seqscan-type operation (such as vacuum does) is a good
> way to lose your cache for no real gain.
Traditionally, seqscan type operations are accommodated in LRU type
managers by having multiple buffer promotion policies, primarily because
it is simple to implement. For example, if you are doing a seqscan, a
buffer loaded from disk is never promoted to the top of the LRU.
Instead it is only partially promoted (say, halfway for example) toward
the top of the buffer list. A page that is already in the buffer is
promoted either to the halfway point or top depending on where it was
found. There are numerous variations on the idea, some being more
clever and complex than others.
The point of this being that a pathological or rare sequential scan can
never trash more than a certain percentage of the cache, while not
significantly impacting the performance of a sequential scan. The
primary nuisance is that it slightly increases the API complexity. I'll
add that I don't know what PostgreSQL actually does in this regard, but
from the thread it appears as though seqscans are handled like the
default case.
Cheers,
-James Rogers
jamesr@best.com
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: jamesr@best.com, andrew@libertyrms.info
Subject: Re: Seqscan buffer promotion (was: reindex/vacuum locking/performance?)
In-Reply-To: <1065459338.26229.26.camel@localhost.localdomain>
* 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