Re: old synchronized scan patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: old synchronized scan patch
Date
Msg-id 5814.1165337104@sss.pgh.pa.us
Whole thread Raw
In response to Re: old synchronized scan patch  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: old synchronized scan patch
List pgsql-hackers
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> Florian G. Pflug wrote:
>> I don't see why a single process wouldn't be reading sequentially - As far
>> as I understood the original proposal, the current blocknumber from the
>> hashtable is only used as a starting point for sequential scans. After 
>> that,
>> each backend reads sequentiall until the end of the table I believe, no?

> When the read is satisfies from shared mem cache, it won't make it to 
> the kernel.

Right, and the *whole point* of this proposal is that only one of the N
processes doing a synchronized scan actually does a read of any
particular block.  The problem is that they're not synchronized well
enough to ensure that it's always the same one.

It strikes me that there's still another thing we'd have to deal with
to make this work nicely.  If you have N processes doing a synchronized
scan, then each block that reaches shared memory is going to be hit N
times in fairly short succession --- which is going to be enough to
convince the bufmgr to keep it in memory for awhile.  Thus a
synchronized seqscan is likely to end up flushing buffer cache in a way
that independent seqscans could not.

This could probably be dealt with by changing the ReadBuffer API to
allow the caller to say "don't increment the refcount on this page",
or some such.  But it's some more work to be done if we intend to
take this idea seriously.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Weak passwords and brute force attacks
Next
From: Jeff Davis
Date:
Subject: Re: old synchronized scan patch