Re: BUG #15987: Improve REINDEX of all indexes of a table at once - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15987: Improve REINDEX of all indexes of a table at once
Date
Msg-id 31841.1567352185@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15987: Improve REINDEX of all indexes of a table at once  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-bugs
Fabien COELHO <coelho@cri.ensmp.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



pgsql-bugs by date:

Previous
From: Jo Tzschenscher
Date:
Subject: Re: BUG #15987: Improve REINDEX of all indexes of a table at once
Next
From: easteregg@verfriemelt.org
Date:
Subject: Re: BUG #15984: order of where in() query affects query planer