Re: pgsql: reindexdb: Add the index-level REINDEX with multiple jobs
Alexander Korotkov <aekorotkov@gmail.com>
From: Alexander Korotkov <aekorotkov@gmail.com>
To: Álvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Alexander Korotkov <akorotkov@postgresql.org>,
pgsql-hackers@lists.postgresql.org, Maxim Orlov <orlovmg@gmail.com>,
Svetlana Derevyanko <s.derevyanko@postgrespro.ru>
Date: 2025-03-09T02:53:29Z
Lists: pgsql-hackers
Attachments
- v1-0001-revert-reindexdb-Add-the-index-level-REINDEX-with.patch (application/octet-stream) patch v1-0001
On Sat, Mar 8, 2025 at 12:49 PM Alexander Korotkov <aekorotkov@gmail.com> wrote: > On Fri, Mar 7, 2025 at 8:20 PM Álvaro Herrera <alvherre@alvh.no-ip.org> wrote: > > > > On 2024-Mar-25, Alexander Korotkov wrote: > > > > > reindexdb: Add the index-level REINDEX with multiple jobs > > > > > > Straight-forward index-level REINDEX is not supported with multiple jobs as > > > we cannot control the concurrent processing of multiple indexes depending on > > > the same relation. Instead, we dedicate the whole table to certain reindex > > > job. Thus, if indexes in the lists belong to different tables, that gives us > > > a fair level of parallelism. > > > > I tested this, because of a refactoring suggestion [1] and I find that > > it's rather completely broken. > > The code was written with assumption that running > run_reindex_command() with async == true can schedule a number of > queries for a connection. But actually that's not true and everything > is broken. The draft patch for revert is attached. Could you, please, check. ------ Regards, Alexander Korotkov Supabase
Commits
-
reindexdb: Fix the index-level REINDEX with multiple jobs
- 09ef2f8df1cd 17.5 landed
- 682c5be25c28 18.0 landed
-
reindexdb: Fix warning about uninitialized indices_tables_cell
- cc0e7ebd304a 17.0 landed
-
reindexdb: Add the index-level REINDEX with multiple jobs
- 47f99a407de2 17.0 cited
-
Rework logic and simplify syntax of REINDEX DATABASE/SYSTEM
- 2cbc3c17a5c1 16.0 cited