Re: REINDEX CONCURRENTLY 2.0
Michael Paquier <michael.paquier@gmail.com>
From: Michael Paquier <michael.paquier@gmail.com>
To: Andreas Karlsson <andreas@proxel.se>
Cc: Michael Banck <michael.banck@credativ.de>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2017-04-03T05:57:24Z
Lists: pgsql-hackers
On Fri, Mar 31, 2017 at 5:12 PM, Andreas Karlsson <andreas@proxel.se> wrote: > Thanks for the feedback. I will look at it when I get the time. > > 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. > and doing the REINDEX per relation allows for flexibility > since people can still explicitly reindex per index of they want to. You have a point here. 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. -- Michael
Commits
-
Prevent reindex of invalid indexes on TOAST tables
- 8bca5f93547c 12.3 landed
- 61d7c7bce368 13.0 landed
-
Rework handling of invalid indexes with REINDEX CONCURRENTLY
- a6dcf9df4d91 12.0 landed
-
Split builtins.h to a new header ruleutils.h
- 7b1c2a0f2066 9.5.0 cited