Re: BUG #15987: Improve REINDEX of all indexes of a table at once

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, hellojo180(at)yahoo(dot)es, PostgreSQL Bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15987: Improve REINDEX of all indexes of a table at once
Date: 2019-09-01 15:36:25
Message-ID: 31841.1567352185@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> writes:
>> I don't quite understand your request. You have REINDEX TABLE which
>> is able to reindex all the indexes of a table one by one, […]

> I understood the request as the scan should be factored out, so that
> reindexing a table with multiple indexes would cost only one seq scan.

I'm not totally convinced that that would be an improvement.
For starters, one would presumably have to divide up maintenance_work_mem
per index, which would be a substantial penalty for some index types.
Also, you'd be creating more randomized I/O on the index-writing side
of the equation (for those index types that write the index during the
scan).

It might net out as a win anyway depending on context, but I don't
think it's as clear-cut as the OP seems to think.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message easteregg 2019-09-02 09:28:07 Re: BUG #15984: order of where in() query affects query planer
Previous Message Jo Tzschenscher 2019-09-01 11:18:33 Re: BUG #15987: Improve REINDEX of all indexes of a table at once