Re: Using read_stream in index vacuum - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Using read_stream in index vacuum
Date
Msg-id CAAKRu_aROAeTx1Z-99UY1wE09NF_BYKG9BzK0ZoGCW+C1rU1tg@mail.gmail.com
Whole thread Raw
In response to Re: Using read_stream in index vacuum  (Junwang Zhao <zhjwpku@gmail.com>)
Responses Re: Using read_stream in index vacuum
List pgsql-hackers
On Mon, Oct 21, 2024 at 4:49 PM Andrei Borodin <x4mmm@yandex-team.ru> wrote:
>
> 21.10.2024, 22:34, "Melanie Plageman" <melanieplageman@gmail.com>:
>
> The whole point of the read stream callback provided by the caller is
> that the logic to get the next block should be there
>
> We must get number of blocks after examining last block. But callback returning EOF might be called before. With
currentAPI we have to restart. 
>
> Removing extension lock will not change this.

I was suggesting you call RelationGetNumberOfBlocks() once
current_block == last_exclusive in the callback itself.

- Melanie



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Using read_stream in index vacuum
Next
From: Melanie Plageman
Date:
Subject: EXPLAIN IndexOnlyScan shows disabled when enable_indexonlyscan=on