| From: | Xuneng Zhou <xunengzhou(at)gmail(dot)com> |
|---|---|
| To: | Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Streamify more code paths |
| Date: | 2025-12-28 11:41:37 |
| Message-ID: | CABPTF7V3+QGC+0W9ERCcAY14jq_w_XvmwrRs9vXbi_oqv4FnTQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Sat, Dec 27, 2025 at 12:41 AM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
>
> Hi Bilal,
>
> Thanks for your review!
>
> On Fri, Dec 26, 2025 at 6:59 PM Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> wrote:
> >
> > Hi,
> >
> > Thank you for working on this!
> >
> > On Thu, 25 Dec 2025 at 09:34, Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
> > >
> > > Hi,
> > >
> > > On Thu, Dec 25, 2025 at 1:51 PM Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
> > > >
> > > > Hi Hackers,
> > > >
> > > > I noticed several additional paths in contrib modules, beyond [1],
> > > > that are potentially suitable for streamification:
> > > >
> > > > 1) pgstattuple — pgstatapprox.c and parts of pgstattuple_approx_internal
> > > > 2) Bloom — 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-trr9r7K76rZExnO2M4SLfvTfbUY2CwQjCekgnQ%40mail.gmail.com
> > > >
> > > > Feedbacks welcome.
> > > >
> > >
> > > One more in ginvacuumcleanup().
> >
> > 0001, 0002 and 0004 LGTM.
> >
> > 0003:
> >
> > + buf = read_stream_next_buffer(stream, NULL);
> > + if (buf == 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 == nblocks);' before read_stream_end() to
> > have a similar check.
> >
>
> Agree. The check has been added in v2 per your suggestion.
>
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.
--
Best,
Xuneng
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0002-Streamify-Bloom-VACUUM-paths-Use-streaming-re.patch | application/x-patch | 4.2 KB |
| v2-0004-Replace-synchronous-ReadBufferExtended-loop-with.patch | application/x-patch | 2.5 KB |
| v2-0001-Switch-Bloom-scan-paths-to-streaming-read.patch | application/x-patch | 2.4 KB |
| v2-0003-Streamify-heap-bloat-estimation-scan-Introduc.patch | application/x-patch | 6.0 KB |
| v2-0005-Streamify-log_newpage_range-WAL-logging-path.patch | application/x-patch | 2.3 KB |
| v2-0006-Streamify-hash-index-VACUUM-primary-bucket-page-r.patch | application/x-patch | 5.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Xuneng Zhou | 2025-12-28 11:45:59 | Re: Streamify more code paths |
| Previous Message | Henson Choi | 2025-12-28 10:44:33 | Re: RFC: PostgreSQL Storage I/O Transformation Hooks |