Re: Streaming read-ready sequential scan code - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Streaming read-ready sequential scan code
Date
Msg-id CAAKRu_aU60EFTLnB86FY9NUT1KqjzjLC2u+DqBtBLWi_ZooFpQ@mail.gmail.com
Whole thread Raw
In response to Re: Streaming read-ready sequential scan code  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: Streaming read-ready sequential scan code
List pgsql-hackers
On Sat, Apr 6, 2024 at 9:25 PM Thomas Munro <thomas.munro@gmail.com> wrote:
>
> I found a bug in read_stream.c that could be hit with Melanie's
> streaming seq scan patch with parallelism enabled and certain buffer
> pool conditions.  Short version: there is an edge case where an "if"
> needed to be a "while", or we could lose a few blocks.  Here's the fix
> for that, longer explanation in commit message.

Attached v13 0001 is your fix and 0002 is a new version of the
sequential scan streaming read user. Off-list Andres mentioned that I
really ought to separate the parallel and serial sequential scan users
into two different callbacks. I've done that in the attached. It
actually makes the code used by the callbacks nicer and more readable
anyway (putting aside performance). I was able to measure a small
performance difference as well.

I've also added a few comments and improved existing comments.

- Melanie

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Streaming read-ready sequential scan code
Next
From: Andres Freund
Date:
Subject: Re: Flushing large data immediately in pqcomm