Re: Some read stream improvements - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Some read stream improvements
Date
Msg-id CA+hUKG+tBTizB4-FdAY_V6r6UBXo-tmEF55h-s+1UfkJieheyw@mail.gmail.com
Whole thread Raw
In response to Re: Some read stream improvements  (Kirill Reshke <reshkekirill@gmail.com>)
List pgsql-hackers
On Mon, Feb 17, 2025 at 6:55 PM Kirill Reshke <reshkekirill@gmail.com> wrote:
> Just out of curiosity, should we `Assert(*index + n <
> stream->queue_size);` in `read_stream_index_advance_n`?

No: it is allowed to be >= queue_size temporarily, but if so we
subtract queue_size.  The result should be equal to (index + n) %
queue_size, assuming small values of n, except we don't want to use %
in hot code.  Perhaps we should assert that though!



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Some read stream improvements
Next
From: Paul Jungwirth
Date:
Subject: Re: SQL:2011 application time