Re: Trying out read streams in pgvector (an extension)

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Trying out read streams in pgvector (an extension)
Date: 2025-11-19 07:27:59
Message-ID: CAN55FZ0tgjF1beJSRXw3rgkbzwPZ7ngChJkPZm9aJkPuaF=dmg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, 19 Nov 2025 at 00:17, Melanie Plageman
<melanieplageman(at)gmail(dot)com> wrote:
>
> To make sure 1) distance isn't reset to a resume_distance from
> read_stream_begin_relation() and 2) unexpected buffers aren't returned
> from the read stream, we could error out in read_stream_resume() if
> pinned_buffers > 0. And in read_stream_reset(), we would save distance
> in resume_distance before clearing distance. That would allow calling
> read_stream_resume() either if you called read_stream_reset() or if
> you exhausted the stream yourself. See rough attached patch for a
> sketch of this.

This looks correct to me. What do you think about using an assert
instead of erroring out?

--
Regards,
Nazir Bilal Yavuz
Microsoft

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-11-19 07:49:56 Re: Extended Statistics set/restore/clear functions.
Previous Message David Geier 2025-11-19 07:25:58 Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?