Add Index-level REINDEX with multiple jobs

From: Maxim Orlov <orlovmg(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Add Index-level REINDEX with multiple jobs
Date: 2023-12-29 13:15:35
Message-ID: CACG=ezZU_VwDi-1PN8RUSE6mcYG+Yx1NH_rJO4+Ke-mKqLp=Nw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

Recently, one of our customers came to us with the question: why do reindex
utility does not support multiple jobs for indices (-i opt)?
And, of course, it is because we cannot control the concurrent processing
of multiple indexes on the same relation. This was
discussed somewhere in [0], I believe. So, customer have to make a shell
script to do his business and so on.

But. This seems to be not that complicated to split indices by parent
tables and do reindex in multiple jobs? Or I miss something?
PFA patch implementing this.

As always, any opinions are very welcome!

[0]
https://www.postgresql.org/message-id/flat/CAOBaU_YrnH_Jqo46NhaJ7uRBiWWEcS40VNRQxgFbqYo9kApUsg%40mail.gmail.com

--
Best regards,
Maxim Orlov.

Attachment Content-Type Size
v1-0001-Add-Index-level-REINDEX-with-multiple-jobs.patch application/octet-stream 8.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-12-29 13:33:07 Re: Fix Brin Private Spool Initialization (src/backend/access/brin/brin.c)
Previous Message Maxim Orlov 2023-12-29 12:48:45 Next step towards 64bit XIDs: Switch to FullTransactionId for PGPROC->xid and XLogRecord->xl_xid