Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT5Tj-00CbLH-0f for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 21:42:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vT5Th-007MbA-2I for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 21:42:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT5Th-007Mb2-1M for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 21:42:37 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vT5Tf-004043-2T for pgsql-hackers@postgresql.org; Tue, 09 Dec 2025 21:42:36 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-6496a8dc5a7so452567a12.2 for ; Tue, 09 Dec 2025 13:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765316554; x=1765921354; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wUPJGgOgG7QhIYx5rXAXMxNWxicNeQ8hSO8GSVJ1NzI=; b=nNNlSCrMkARJd7NxHp6X37QYc4jf1vgEE6kjnsar83YTtnwaxaUxNBZPQ1g+wRKjH0 8pJiUsdz/l+gRKWsph9qa1tF7E57M2wq4cdcc0+e01I29+mDwWl/9krH1DAJ6xqwAdg5 Zl87w/vDkB6rRzeKKNfnd13oBIJI15PFc8FIwKhW+RUFqiC3POsaaZLhmf/ISUlCVHAs FgldR4+LZgV7RjmBIitvweStA67M63RTAKo+bs7pvdwF+INw8w+iQ5BY7ipLStrCdZD9 YbIiP2GujJ9tpn5g3qNilKve3NDziyeMS3BZQNjJQLP9g44ux9qrEYqNKOoHQoDKQprf qFOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765316554; x=1765921354; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wUPJGgOgG7QhIYx5rXAXMxNWxicNeQ8hSO8GSVJ1NzI=; b=nNaoZL4kEPS4EsML+yoCdvGqWshR/VzMG2OYV8HtVMVf+dal/L3N5WEoqXaNpvp19X aIwgeTS6sQ53l6A2r34CWbofov28XT/rBKyjr5bNXiR+Ku8gPIc6aXFZzXC/hNTunZXV t6HuVkfGuoaJ3h9YjcuwPMQd7xaIxJVs/fDYRgOYWg7COWGcQQLGDx2382Arc82YMvHO A813ZXkOVffwSqvCK+e0ocMFj378xDP7igUjpG+LXA9QFIFwpvNyFS0E/OzS9zYvFfQ8 nkvGoxwR9TJvrpw9IS8uIpS/vCsFcUGu+kDVwka7rq+AeqMWzQRCOX1e5JwSEo1PDRt7 E3WQ== X-Forwarded-Encrypted: i=1; AJvYcCUIfW9MVAO86xoOUHY3hlqfiQeHJ7ykdvzlQQfmGTAo3DH6c541RZDbymeX7NONSbOyIzEeB7I23fibfd+W@postgresql.org X-Gm-Message-State: AOJu0YzOjO3SV6xzVQ2z9dhRfbhvLWp4XGhIocUXngQdrpcoYTxfGTV/ qQPws8DAXbRYXj5Z49lyi9IGgIoV+YvEgDHz7JAqQFg3YiKCKpozfXSeHzNCttghkn6AyakApP1 uFk97JqbD4OuTl/5NaC3D+aXd6piWR60= X-Gm-Gg: AY/fxX6oKWEYFAMIqYkQ3xcKp57p99f6BKqAsoTCo3XbU5aX9L9cCK0Gnajdiw0eCQJ kFDCecsunpiYy5y7H8eYACyjIeyDZ17voZVPTviNjH8ctcjlREoyXKF8gfrOevq0gFomgn0bRFH jWCAP2w1LfwBq9TIRd5uwrQPv4yrr22wbhaC3qKY18U3Iq+qiErETOMdG2LwKeDQMZfGh4xxnkv 0VQhUaVwpvfhxi0Jw/kIOBDSpL/Dlc18f/Gwj5d0L1L9eSYU8bvUvgOnxrmVwAatqF3KMTg X-Google-Smtp-Source: AGHT+IHZQB4GlQWiwBK3NY5wDMvy+UQlJ1ctlPeHn0BMfvChFMPoce5v5DkjetEyKEaHyCTkYzjBAY04joosF3bf2EU= X-Received: by 2002:a05:6402:34c9:b0:643:129f:9d74 with SMTP id 4fb4d7f45d1cf-6496cb2e29amr356194a12.7.1765316553734; Tue, 09 Dec 2025 13:42:33 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Melanie Plageman Date: Tue, 9 Dec 2025 16:42:21 -0500 X-Gm-Features: AQt7F2rS5o9hN-FL1LJh0-wxh-ogrlNGffK9JkV6UX_L7P6essFO_byJBcyHImM Message-ID: Subject: Re: Trying out read streams in pgvector (an extension) To: Thomas Munro Cc: Peter Geoghegan , Nazir Bilal Yavuz , "Jonathan S. Katz" , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Dec 8, 2025 at 10:47=E2=80=AFPM Thomas Munro wrote: > > I think it'd be better if that were the consumer's choice. I don't > want the consumer to be required to drain the stream before resuming, > as that'd be an unprincipled stall. For example, if new WAL arrives > over the network then I think it should be possible for recovery's > WAL-powered stream of heap pages to resume looking ahead even if > recovery hasn't drained the existing stream completely. > > 1. read_stream_resume() as before, but with a new explicit > read_stream_pause(): if a block number callback would like to report a > temporary lack of information, it should return > read_stream_pause(stream), not InvalidBlockNumber. Then after > read_stream_resume(stream) is called, the next > read_stream_next_buffer() enters the lookahead loop again. While > paused, if the consumer drains all the existing buffers in the stream > and then one more, it will receive InvalidBuffer, but if the _resume() > call is made sooner, the consumer won't ever know about the temporary > lack of buffers in the stream. I like this new interface. If the user does want to exhaust the stream (as was the case with earlier pgvector read stream user code), I assume you would want to do: read_stream_pause() read_stream_reset() read_stream_resume() - Melanie