Re: read stream on amcheck

From: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: read stream on amcheck
Date: 2025-03-27 20:56:39
Message-ID: CAFY6G8dLQ-2f-0EkvFNnT9bf76RYJQVMfLa55tXUwhRJ+34kaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 27, 2025 at 4:42 PM Melanie Plageman
<melanieplageman(at)gmail(dot)com> wrote:
>
> On Thu, Mar 27, 2025 at 2:46 PM Matheus Alcantara
> <matheusssilv97(at)gmail(dot)com> wrote:
> >
> > Just my 0.2 cents. I also like the first approach even though I prefer
> > the v4 version, but anyway, thanks very much for reviewing and
> > committing!
>
> Thanks for the patch!
>
> FWIW, I strongly disliked about v4 that two separate parts of the
> callback were responsible for advancing current_blocknum, one to
> advance it past blocks we chose to skip and the other to advance it to
> the next block.
>
> for (; p->current_blocknum < p->last_exclusive; p->current_blocknum++)
> and
> if (p->current_blocknum < p->last_exclusive)
> return p->current_blocknum++;
>
> I found that alone to be undesirable, but once you add in
> SKIP_PAGES_NONE, I think it was very hard to understand.
>
> Besides that, when we implemented streaming read sequential scan, we
> ended up making dedicated callbacks for the parallel and non-parallel
> cases (see heap_scan_stream_read_next_parallel and
> heap_scan_stream_read_next_serial) because it performed better than a
> single combined callback with a branch. I didn't validate that amcheck
> got the same performance benefit from the dedicated callbacks, but I
> don't see why it would be any different.

Yeah, it totally makes sense to me now, thanks very much for the details!

--
Matheus Alcantara

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-03-27 20:58:11 Re: AIO v2.5
Previous Message Mahendra Singh Thalor 2025-03-27 20:07:20 Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote