Re: Add Index-level REINDEX with multiple jobs

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Maxim Orlov <orlovmg(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add Index-level REINDEX with multiple jobs
Date: 2024-03-22 15:45:05
Message-ID: CAPpHfduPAqjm_E80n2mVSVLi_5vKbTthjOr2p-ktX5UbipzJFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 20, 2024 at 7:19 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> On Mon, Mar 11, 2024 at 3:44 PM Maxim Orlov <orlovmg(at)gmail(dot)com> wrote:
> > On Tue, 6 Feb 2024 at 09:22, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> >> The problem may be actually trickier than that, no? Could there be
> >> other factors to take into account for their classification, like
> >> their sizes (typically, we'd want to process the biggest one first, I
> >> guess)?
> >
> >
> > Sorry for a late reply. Thanks for an explanation. This is sounds reasonable to me.
> > Svetlana had addressed this in the patch v2.
>
> I think this patch is a nice improvement. But it doesn't seem to be
> implemented in the right way. There is no guarantee that
> get_parallel_object_list() will return tables in the same order as
> indexes. Especially when there is "ORDER BY idx.relpages". Also,
> sort_indices_by_tables() has quadratic complexity (probably OK since
> input list shouldn't be too lengthy) and a bit awkward.
>
> I've revised the patchset. Now appropriate ordering is made in SQL
> query. The original list of indexes is modified to match the list of
> tables. The tables are ordered by the size of its greatest index,
> within table indexes are ordered by size.
>
> I'm going to further revise this patch, mostly comments and the commit message.

Here goes the revised patch. I'm going to push this if there are no objections.

------
Regards,
Alexander Korotkov

Attachment Content-Type Size
v4-0001-Add-the-index-level-REINDEX-with-multiple-jobs.patch application/octet-stream 9.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-03-22 15:49:29 Re: SQL:2011 application time
Previous Message Robert Haas 2024-03-22 15:39:43 Re: [PATCH] plpython function causes server panic