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 1173233417.13722.544.camel@dogma.v10.wvs
Whole thread Raw
In response to Re: Bug: Buffer cache is not scan resistant  (Jim Nasby <decibel@decibel.org>)
List pgsql-hackers
On Tue, 2007-03-06 at 17:43 -0700, Jim Nasby wrote:
> On Mar 6, 2007, at 10:56 AM, Jeff Davis wrote:
> >> We also don't need an exact count, either. Perhaps there's some way
> >> we could keep a counter or something...
> >
> > Exact count of what? The pages already in cache?
> 
> Yes. The idea being if you see there's 10k pages in cache, you can  
> likely start 9k pages behind the current scan point and still pick  
> everything up.
> 
> But this is nowhere near as useful as the bitmap idea, so I'd only  
> look at it if it's impossible to make the bitmaps work. And like  
> others have said, that should wait until there's at least a first- 
> generation patch that's going to make it into 8.3.

You still haven't told me how we take advantage of the OS buffer cache
with the bitmap idea. What makes you think that my current
implementation is "nowhere near as useful as the bitmap idea"?

My current implementation is making use of OS buffers + shared memory;
the bitmap idea can only make use of shared memory, and is likely
throwing the OS buffers away completely.

I also suspect that the bitmap idea relies too much on the idea that
there's a contiguous cache trail in the shared buffers alone. Any
devation from that -- which could be caused by PG's page replacement
algorithm, especially in combination with a varied load pattern -- would
negate any benefit from the bitmap idea. I feel much more confident that
there will exist a trail of pages that are cached in *either* the PG
shared buffers *or* the OS buffer cache. There may be holes/gaps in
either one, but it's much more likely that they combine into a
contiguous series of cached pages. Do you have an idea how I might test
this claim?

Regards,Jeff Davis




pgsql-hackers by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: Aggressive freezing in lazy-vacuum
Next
From: ITAGAKI Takahiro
Date:
Subject: Re: Aggressive freezing in lazy-vacuum