Re: Using read_stream in index vacuum

From: Junwang Zhao <zhjwpku(at)gmail(dot)com>
To: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Subject: Re: Using read_stream in index vacuum
Date: 2024-10-20 10:16:01
Message-ID: CAEG8a3LkMMYmJOQrYdLtnQpkpEvP=gyB6ERZuy_rTUPC5LD6uQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 20, 2024 at 3:19 PM Andrey M. Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>
>
>
> > On 19 Oct 2024, at 20:41, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> >
> > I'm wondering why is the case, ISTM that we can do *p.current_blocknum
> > = scanblkno*
> > and *p.last_exclusive = num_pages* in each loop of the outer for?
>
> Thanks for reviewing!
> AFAIK we cannot restart stream if it's finished, so we have a race condition of main loop and callback caller.
> Resolving this race condition would make code much more complex for a relatively small benefit.

I'm not sure if I did not express myself correctly, I didn't mean to
restart the stream,
I mean we can create a new stream for each outer loop, I attached a
refactor 0002
based on your 0001, correct me if I'm wrong.

>
> I'll address typos in next patch version, thank you for looking into this.
>
>
> Best regards, Andrey Borodin.
>

--
Regards
Junwang Zhao

Attachment Content-Type Size
v2-0001-Prototype-B-tree-vacuum-streamlineing.patch application/octet-stream 4.6 KB
v2-0002-refactor.patch application/octet-stream 3.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nitin Motiani 2024-10-20 13:11:37 Re: Inval reliability, especially for inplace updates
Previous Message Alvaro Herrera 2024-10-20 10:14:10 Re: Add pg_ownerships and pg_privileges system views