Re: Bug: Buffer cache is not scan resistant - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Bug: Buffer cache is not scan resistant
Date
Msg-id 1173125991.13722.327.camel@dogma.v10.wvs
Whole thread Raw
In response to Re: Bug: Buffer cache is not scan resistant  (Heikki Linnakangas <heikki@enterprisedb.com>)
Responses Re: Bug: Buffer cache is not scan resistant  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 2007-03-05 at 09:09 +0000, Heikki Linnakangas wrote:
> In fact, the pages that are left in the cache after the seqscan finishes 
> would be useful for the next seqscan of the same table if we were smart 
> enough to read those pages first. That'd make a big difference for 
> seqscanning a table that's say 1.5x your RAM size. Hmm, I wonder if 
> Jeff's sync seqscan patch adresses that.
> 

Absolutely. I've got a parameter in my patch "sync_scan_offset" that
starts a seq scan N pages before the position of the last seq scan
running on that table (or a current seq scan if there's still a scan
going). 

If the last scan is not still in progress, the pages are less likely to
be in cache. If the pages are in cache, great; if not, it doesn't matter
where we start anyway.

If the last scan is still in progress, those recently-read pages are
very likely to be in cache (shared buffers or OS buffer cache).

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug: Buffer cache is not scan resistant
Next
From: Tom Lane
Date:
Subject: Re: proposal: custom variables management