回复:回复:回复:how to create index concurrently on partitioned table

From: 李杰(慎追) <adger(dot)lj(at)alibaba-inc(dot)com>
To: "Michael Paquier" <michael(at)paquier(dot)xyz>, "Justin Pryzby" <pryzby(at)telsasoft(dot)com>
Cc: "pgsql-hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, 曾文旌(义从) <wenjing(dot)zwj(at)alibaba-inc(dot)com>, "Alvaro Herrera" <alvherre(at)2ndquadrant(dot)com>
Subject: 回复:回复:回复:how to create index concurrently on partitioned table
Date: 2020-06-17 14:22:28
Message-ID: f1224993-2db9-48af-b3e7-5676942394b1.adger.lj@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> We can refer to the implementation in the ReindexRelationConcurrently,
> in the three phases of the REINDEX CONCURRENTLY,
> all indexes of the partitions are operated one by one in each phase.
> In this way, we can maintain the consistency of the entire partitioned table index.
> After we implement CIC in this way, we can also complete reindex partitioned table index concurrently (this is not done now.)

After careful analysis, I found that there were two choices that embarrassed me.
Although we can handle the entire partition tree with one transaction in each of the three phases of CIC, just like ordinary tables.

However, I found a problem. If there are many partitions,
we may need to handle too many missing index entries when validate_index() .
Especially for the first partition, the time may have been long and many entries are missing.
In this case, why don't we put the second and third phase together into a transaction for each partition?

So, which schema do you think is better?
Choose to maintain consistency in all three phases,
or just maintain consistency in the first phase?

Thank you very much,
Regards, Adger

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2020-06-17 14:34:31 Re: global barrier & atomics in signal handlers (Re: Atomic operations within spinlocks)
Previous Message Andrew Dunstan 2020-06-17 14:15:40 Re: language cleanups in code and docs