Re: REINDEX CONCURRENTLY 2.0

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Michael Banck <michael(dot)banck(at)credativ(dot)de>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: REINDEX CONCURRENTLY 2.0
Date: 2017-04-03 12:25:27
Message-ID: 3af4b7e0-a2d6-6b6c-8e77-7cb674e8ac98@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/03/2017 07:57 AM, Michael Paquier wrote:
> On Fri, Mar 31, 2017 at 5:12 PM, Andreas Karlsson <andreas(at)proxel(dot)se> wrote:
>> On 03/31/2017 08:27 AM, Michael Paquier wrote:
>>> - Do a per-index rebuild and not a per-relation rebuild for concurrent
>>> indexing. Doing a per-relation reindex has the disadvantage that many
>>> objects need to be created at the same time, and in the case of
>>> REINDEX CONCURRENTLY time of the operation is not what matters, it is
>>> how intrusive the operation is. Relations with many indexes would also
>>> result in much object locks taken at each step.
>>
>> I am personally worried about the amount time spent waiting for long running
>> transactions if you reindex per index rather than per relation. Because when
>> you for one index wait on long running transactions nothing prevents new
>> long transaction from starting, which we will have to wait for while
>> reindexing the next index. If your database has many long running
>> transactions more time will be spent waiting than the time spent working.
>
> Yup, I am not saying that one approach or the other are bad, both are
> worth considering. That's a deal between waiting and manual potential
> cleanup in the event of a failure.

Agreed, and which is worse probably depends heavily on your schema and
workload.

> I am marking this patch as returned with feedback, this won't get in
> PG10. If I am freed from the SCRAM-related open items I'll try to give
> another shot at implementing this feature before the first CF of PG11.

Thanks! I also think I will have time to work on this before the first CF.

Andreas

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-04-03 13:07:33 Rewriting the test of pg_upgrade as a TAP test
Previous Message Daniel Verite 2017-04-03 12:12:45 Re: Variable substitution in psql backtick expansion