Seqscan buffer promotion (was: reindex/vacuum locking/performance?)

From: James Rogers <jamesr(at)best(dot)com>
To: Andrew Sullivan <andrew(at)libertyrms(dot)info>
Cc: PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Seqscan buffer promotion (was: reindex/vacuum locking/performance?)
Date: 2003-10-06 16:55:38
Message-ID: 1065459338.26229.26.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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(at)best(dot)com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Sean Chittenden 2003-10-06 17:01:36 Re: count(*) slow on large tables
Previous Message Josh Berkus 2003-10-06 16:33:27 Re: Shopping for hardware