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 1vaAxO-004itY-1X for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Dec 2025 10:58:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vaAxN-00GZ0h-1H for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Dec 2025 10:58:34 +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 1vaAxN-00GZ0Y-0I for pgsql-hackers@lists.postgresql.org; Mon, 29 Dec 2025 10:58:33 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vaAxM-003AIs-1U for pgsql-hackers@lists.postgresql.org; Mon, 29 Dec 2025 10:58:32 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-c03eb31db80so6825893a12.2 for ; Mon, 29 Dec 2025 02:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767005911; x=1767610711; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XV6R6l2dbA42+r+f2x1Z6AFLfooZ5QZMnPkKcKYNByA=; b=Ovbe0Jbdr6hJ1T1o3WPmu1WXolMrd0+mAD3W8haGZ5HU2hJXpRWN2iDuGUJaSERM9O 9+S0iWyR9ewk5b/nw0KWij1rY++lD0iWTNC62cggz++mMxApr1WgzVLVAbcvf8d73qd/ RXR71gZHMGEQ1aVYf4bp8FOBEO9YLVLs0HnWjZv79haCu3OKzwkS1+7FN5Z7lJjP9hy1 bPNN9X/qPB90HRbsgzBRkeXf/lSkkioUOgVDu0OahxqOp/5J17EvUfGNknpQ0gT7HGOU /VnmeHEvuDTjhsN0jym336EkerN/JlpH0hvZb3wdmr0yoq2mn6zRw52+wFfhHP0x0sc4 +1Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767005911; x=1767610711; h=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=XV6R6l2dbA42+r+f2x1Z6AFLfooZ5QZMnPkKcKYNByA=; b=Qjvt5F0HQs/iQtMbuq1trGumdcYTRhmXzOnrNswoaKAG2jHgCbpMcjBDw/VhYsXngb AQNMLdW7hST3/MeI8tgjb+2EnyUZh9e/w7RIkPZjS8uOaih5s9/nRO7Cuo7xPe3E1DE2 ZAzCPSvUAFwiTVbJr4YN7k7o33jNmC1wWeb8kMgJTrNHj/hTSJql/aVbbtpVge0NOvxN +fB01adKo2dgRl8HZuBpzGE+QbG7swH9CroClADyvoIr4Qcfma5xS4Qbjs1NhgfYrO+m vABK+CvWra/gCJn1KH3scKABTkD3CWrJyh38fUEdObQiCULkhQAfu7nn8N4aWQob/aBf o/xg== X-Gm-Message-State: AOJu0YwhPce2PmfvO13gaKCMcx/oKEvIuWy0glFORXfPcU6Qy1gSaOl3 FTKJXl4xsi3S1CAITnzsifO2riYA6s+MZd8t0B05GfKjiCNHRfaWQnJPAlQx98FDzeYTFfQqSby nUUNHgx4nW76rledQ3EJqo1wcKfF/QZs= X-Gm-Gg: AY/fxX5oYzM9BN8ytpFfllaPJxDVLgXg8ESfQG8+xkxn8uVG5/2X42f8f46KGsEplWN ryHKcUFbJO2bE66rlpw8TL1D8K5Ule5wNppglO95YSB8YdFyhpmz8OlzETUk4H37qjDSv8S5Eaa 01mVqQ0URZ3fTDNDOeqvGr/tLZvAx3Pu5ZbuLPwIWjdoPAMvuYukngvwBl6UKNuZgFuUSQ4GR8p Y1mZi8d+llfb1YbWvm9VmJAAmvGpuc16QffYzUKe3g/od4HUrRrjJT2CldhztPGet/eVS/9EPCu HycB X-Google-Smtp-Source: AGHT+IF/oFpx1xlNZMx1DCEcMNCvGhOob7IHQliiwaw834i13Bp8QHmS90YEGxXk2rVTWEGhoZX38mWzUow4YdYpLLQ= X-Received: by 2002:a05:7300:d58b:b0:2b0:4f34:eed3 with SMTP id 5a478bee46e88-2b05ec3d5e0mr16332298eec.27.1767005911173; Mon, 29 Dec 2025 02:58:31 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nazir Bilal Yavuz Date: Mon, 29 Dec 2025 13:58:19 +0300 X-Gm-Features: AQt7F2q3w7AsWjg-Ci4YjYxnLAKoIgWOuPJXgDgk8P2DdZvU9TeWsZqh0T9rbDU Message-ID: Subject: Re: Streamify more code paths To: Xuneng Zhou Cc: pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, 28 Dec 2025 at 14:46, Xuneng Zhou wrote: > > Hi, > > > > Two more to go: > > patch 5: Streamify log_newpage_range() WAL logging path > > patch 6: Streamify hash index VACUUM primary bucket page reads > > > > Benchmarks will be conducted soon. > > > > v6 in the last message has a problem and has not been updated. Attach > the right one again. Sorry for the noise. 0003 and 0006: You need to add 'StatApproxReadStreamPrivate' and 'HashBulkDeleteStreamPrivate' to the typedefs.list. 0005: @@ -1321,8 +1341,10 @@ log_newpage_range(Relation rel, ForkNumber forknum, nbufs = 0; while (nbufs < XLR_MAX_BLOCK_ID && blkno < endblk) { - Buffer buf = ReadBufferExtended(rel, forknum, blkno, - RBM_NORMAL, NULL); + Buffer buf = read_stream_next_buffer(stream, NULL); + + if (!BufferIsValid(buf)) + break; We are loosening a check here, there should not be a invalid buffer in the stream until the endblk. I think you can remove this BufferIsValid() check, then we can learn if something goes wrong. 0006: You can use read_stream_reset() instead of read_stream_end(), then you can use the same stream with different variables, I believe this is the preferred way. Rest LGTM! -- Regards, Nazir Bilal Yavuz Microsoft