From: Michael Paquier <michael@paquier.xyz>
To: 李杰(慎追) <adger.lj@alibaba-inc.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Cc: 曾文旌(义从) <wenjing.zwj@alibaba-inc.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Subject: Re: 回复:how to create index concurrently on partitioned table
Date: Mon, 15 Jun 2020 21:37:42 +0900
Message-ID: <20200615123742.GL52676@paquier.xyz> (raw)
In-Reply-To: <55841c84-4ab6-4c79-9d1c-f67db2b229db.adger.lj@alibaba-inc.com>
References: <3c2edeb5-e216-4411-9a74-f27fcc0f6793.adger.lj@alibaba-inc.com>
<20200612072017.GE3362@paquier.xyz>
<20200612181542.GJ14879@telsasoft.com>
<55841c84-4ab6-4c79-9d1c-f67db2b229db.adger.lj@alibaba-inc.com>
On Mon, Jun 15, 2020 at 08:15:05PM +0800, 李杰(慎追) wrote:
> As shown above, an error occurred while creating an index in the second partition.
> It can be clearly seen that the index of the partitioned table is invalid
> and the index of the first partition is normal, the second partition is invalid,
> and the Third Partition index does not exist at all.
That's a problem. I really think that we should make the steps of the
concurrent operation consistent across all relations, meaning that all
the indexes should be created as invalid for all the parts of the
partition tree, including partitioned tables as well as their
partitions, in the same transaction. Then a second new transaction
gets used for the index build, followed by a third one for the
validation that switches the indexes to become valid.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: michael@paquier.xyz, adger.lj@alibaba-inc.com, pryzby@telsasoft.com, pgsql-hackers@lists.postgresql.org, wenjing.zwj@alibaba-inc.com, alvherre@2ndquadrant.com
Subject: Re: 回复:how to create index concurrently on partitioned table
In-Reply-To: <20200615123742.GL52676@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox