Re: REINDEX CONCURRENTLY 2.0

From: Jim Nasby <jim(at)nasby(dot)net>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: REINDEX CONCURRENTLY 2.0
Date: 2014-01-10 00:59:20
Message-ID: 52CF45E8.6090208@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry for the lateness of this...

On 11/14/13, 8:40 PM, Michael Paquier wrote:
> + /*
> + * Phase 4 of REINDEX CONCURRENTLY
> + *
> + * Now that the concurrent indexes have been validated could be used,
> + * we need to swap each concurrent index with its corresponding old index.
> + * Note that the concurrent index used for swaping is not marked as valid
> + * because we need to keep the former index and the concurrent index with
> + * a different valid status to avoid an implosion in the number of indexes
> + * a parent relation could have if this operation fails multiple times in
> + * a row due to a reason or another. Note that we already know thanks to
> + * validation step that
> + */
> +

Was there supposed to be more to that comment?

In the loop right below it...

+ /* Swap the indexes and mark the indexes that have the old data as invalid */
+ forboth(lc, indexIds, lc2, concurrentIndexIds)
...
+ CacheInvalidateRelcacheByRelid(relOid);

Do we actually need to invalidate the cache on each case? Is it because we're grabbing a new transaction each time through?
--
Jim C. Nasby, Data Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-01-10 01:16:50 Re: Turning off HOT/Cleanup sometimes
Previous Message Marko Tiikkaja 2014-01-10 00:36:33 Re: array_length(anyarray)