From: | Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com> |
---|---|
To: | Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> |
Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andrey Borodin <amborodin86(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com> |
Subject: | Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements |
Date: | 2025-01-18 14:18:00 |
Message-ID: | CANtu0ogtWQvWry72crtt7ZHq22ZLRprFYC_FW3VZ7qtQc1MwpQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello, everyone!
This is an updated version, contains some optimization into STIR index
access method, related to the fact it is never used with WAL.
> The locking in stirinsert can probably be improved significantly if
> we use things like atomic operations on STIR pages. We'd need an
> exclusive lock only for page initialization, while share locks are
> enough if the page's data is modified without WAL. That should improve
> concurrent insert performance significantly, as it would further
> reduce the length of the exclusively locked hot path.
Mathias, you were proposed to use just shared locking to writes, but how is
it possible if it is required to mark page as dirty, and it requires
exclusive lock?
> It occurs because the first phase is slow, and many tuples need to be
inserted during the validation phase.
> For each tuple, heapam_index_fetch_tuple is called, even for those on the
same page.
> It might be possible to implement a batched version of
heapam_index_fetch_tuple to handle multiple tuples on the same page and
mitigate this issue.
It was a wrong assumption. It looks like it is happening because of
prefetching. I'll try to add it in the validation phase.
Best regards,
Mikhail.
From | Date | Subject | |
---|---|---|---|
Next Message | Andrey M. Borodin | 2025-01-18 16:31:12 | Re: Timeline issue if StartupXLOG() is interrupted right before end-of-recovery record is done |
Previous Message | Michail Nikolaev | 2025-01-18 13:03:33 | Re: Issue with markers in isolation tester? Or not? |