Re: WIP: parallel GiST index builds

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: WIP: parallel GiST index builds
Date: 2024-07-26 12:13:52
Message-ID: 6D47292A-CC56-4289-9AFA-DA84EF2ABE57@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 26 Jul 2024, at 14:30, Andreas Karlsson <andreas(at)proxel(dot)se> wrote:
>
> I feel the tricky part about doing that is that we need to make sure the fake LSNs are all less than the current real LSN when the index build completes and while that normally should be the case we will have a almost never exercised code path for when the fake LSN becomes bigger than the real LSN which may contain bugs. Is that really worth it to optimize.
>
> But if we are going to use fake LSN: since the index being built is not visible to any scans we do not have to use GetFakeLSNForUnloggedRel() but could use an own counter in shared memory in the GISTShared struct for this specific index which starts at FirstNormalUnloggedLSN. This would give us slightly less contention plus decrease the risk (for good and bad) of the fake LSN being larger than the real LSN.

+1 for atomic counter in GISTShared.
BTW we can just reset LSNs to GistBuildLSN just before doing log_newpage_range().

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2024-07-26 12:22:50 Re: Protocol question regarding Portal vs Cursor
Previous Message Alexander Korotkov 2024-07-26 12:10:32 Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.