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 1vZ5Xq-0030SH-01 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Dec 2025 10:59:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vZ5Xo-009DlT-28 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Dec 2025 10:59:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vZ5Xo-009DlK-0x for pgsql-hackers@lists.postgresql.org; Fri, 26 Dec 2025 10:59:41 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vZ5Xm-002uwK-0Q for pgsql-hackers@lists.postgresql.org; Fri, 26 Dec 2025 10:59:40 +0000 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-bf1b402fa3cso7069307a12.3 for ; Fri, 26 Dec 2025 02:59:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766746776; x=1767351576; darn=lists.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=/Iw+fPedc8LY2teis/OXI3ui7yMkIGjZBSK/fkVEEWw=; b=NYjRFNlF/8JQZhMB3YuuSDlbqMkGuHI9iTOQW6GazjslxFQMIBuGqpdZd3dAloB5E0 Bk8kU3zLJLUMkSgmXGImcRhsNut7hcz6gUfNCR3kpnS8Vc4mAbZ2n/NlozzoArWu1ksx GVVqi3G0+OMzlKMRHKS5E5H54XpFGppVv3NJoNKM+Zu4WReFbs5dHfPFLNvr/9r5vnlU yCDqkCQ2AAeqRqonnJ8Ju7KEuj3r1qsQhdtmo5d1GZv9QNhaEqyxeDgDLShznBvt4kPX Srsu1OHSucY5Tx69K7JETJQ8vpjdrAbBMH21YY3Cxsz5jgKFy0wdoQE8NgE5on4OlMiO Z/mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766746776; x=1767351576; 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=/Iw+fPedc8LY2teis/OXI3ui7yMkIGjZBSK/fkVEEWw=; b=E3b33NxapuUnWBSDQmYR2rGe39G7G6YcCiMY5I9rxOovTLsVKyWv5RPX89EOf3q39w MtjJRy5aAuL0VAg29JXwG1sUmZ329ol8nyCPjL1KY4ZWxx5DCQhH3dj0CrZ+sygDrQOo TSNTKXXLAiUzRGMP2OAEq9vWc8BXLkK77GDBb9IRr/QXZC3QLcmVXjlVetJe1kt9ZfsP rNoDaJKusKAdsCb+BhTClSNypUVz0fbxb8sqTQvrYt/+lXAm/bipBWu6DrR4al39Xnl/ k4RmIc/sLTPGNZctlZhjIZwDEy3VDcjNoDPv84fSDwEq7ib5nRJ172KOtykwqB8b+Yeg PHpg== X-Gm-Message-State: AOJu0YxxT3aUUDCfefECQxKZrvQWk3uD3GUeXzFxfAO+cpSd0JQ7NUDx a/7eaDmu903sLs6KDbWBJzlaxZdh096XDfcVZQTdJuATTk7SXqInJLZmXSedoAZS+fXauIHGTtS wUruw+IxUbIE2hahRJBvMyqphEYrwIu4= X-Gm-Gg: AY/fxX51fF+IG5W6wLV8o7NK9TrLxKzobuL/51EPa1jKMyC8zGjw1EidqgdL1LYiKWw QjGEKyfNc4xFEkOyPwdN/Zg4iTqio2KbyviXRZ4l+YKe4QTT+gWsThOgrchesQ4+FJIhtd0+0mb MLc5NcmbGIa60a+Qzo93gauJrhDNMvaxJe/oT13aq0GrjKldLRs+v35WervXC/tcerybFQ+MMCU 3EvQBHTACnZFsP3pioyzCeVqI6180OLvC1iyf2yq62+cVv5e12NYvK/OxxFvsnteEOzJw== X-Google-Smtp-Source: AGHT+IEGLq1uZw/DAgA8qv44Mu4r6dBayMnbPLcXmQr6fgTCsT63v4pQUaOEjGBft0dfUXRss8Q2f8blJpAsA51/UhE= X-Received: by 2002:a05:7301:da0b:b0:2ae:5a9f:d98c with SMTP id 5a478bee46e88-2b05ec56b02mr14959728eec.33.1766746775666; Fri, 26 Dec 2025 02:59:35 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nazir Bilal Yavuz Date: Fri, 26 Dec 2025 13:59:24 +0300 X-Gm-Features: AQt7F2q50iM8MUiSYRcPgVTN9iaoM2PU4MvDP0-b2fY6N6ucm8e46IcnhEG5u2c Message-ID: Subject: Re: Streamify more code paths To: Xuneng Zhou Cc: 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 Hi, Thank you for working on this! On Thu, 25 Dec 2025 at 09:34, Xuneng Zhou wrote: > > Hi, > > On Thu, Dec 25, 2025 at 1:51=E2=80=AFPM Xuneng Zhou wrote: > > > > Hi Hackers, > > > > I noticed several additional paths in contrib modules, beyond [1], > > that are potentially suitable for streamification: > > > > 1) pgstattuple =E2=80=94 pgstatapprox.c and parts of pgstattuple_approx= _internal > > 2) Bloom =E2=80=94 scan paths in blgetbitmap() and maintenance paths in= blbulkdelete() > > > > The following patches streamify those code paths. No benchmarks have > > been run yet. > > > > [1] https://www.postgresql.org/message-id/flat/CABPTF7UeN2o-trr9r7K76rZ= ExnO2M4SLfvTfbUY2CwQjCekgnQ%40mail.gmail.com > > > > Feedbacks welcome. > > > > One more in ginvacuumcleanup(). 0001, 0002 and 0004 LGTM. 0003: + buf =3D read_stream_next_buffer(stream, NULL); + if (buf =3D=3D InvalidBuffer) + break; I think we are loosening the check here. We were sure that there were no InvalidBuffers until the nblocks. Streamified version does not have this check, it exits from the loop the first time it sees an InvalidBuffer, which may be wrong. You might want to add 'Assert(p.current_blocknum =3D=3D nblocks);' before read_stream_end() to have a similar check. -- Regards, Nazir Bilal Yavuz Microsoft