回复:回复:回复:how to create index concurrently on partitioned table
李杰 (慎追) <adger.lj@alibaba-inc.com>
From: 李杰(慎追) <adger.lj@alibaba-inc.com>
To: "Michael Paquier" <michael@paquier.xyz>,
"Justin Pryzby" <pryzby@telsasoft.com>
Cc: "pgsql-hackers" <pgsql-hackers@lists.postgresql.org>, 曾文旌(义从) <wenjing.zwj@alibaba-inc.com>, "Alvaro Herrera" <alvherre@2ndquadrant.com>
Date: 2020-06-17T14:22:28Z
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
Commits
-
Allow CLUSTER on partitioned tables
- cfdd03f45e6a 15.0 landed
-
Add support for partitioned tables and indexes in REINDEX
- a6642b3ae060 14.0 landed
-
Local partitioned indexes
- 8b08f7d4820f 11.0 cited