Re: how to create index concurrently on partitioned table - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: how to create index concurrently on partitioned table
Date
Msg-id 20200611153502.GT14879@telsasoft.com
Whole thread Raw
In response to Re: how to create index concurrently on paritioned table  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: how to create index concurrently on partitioned table  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Sun, Jun 07, 2020 at 01:04:48PM -0500, Justin Pryzby wrote:
> On Sat, Jun 06, 2020 at 09:23:32AM -0500, Justin Pryzby wrote:
> > On Wed, Jun 03, 2020 at 08:22:29PM +0800, 李杰(慎追) wrote:
> > > Partitioning is necessary for very large tables.  However, I found that
> > > postgresql does not support create index concurrently on partitioned
> > > tables.  The document show that we need to create an index on each
> > > partition individually and then finally create the partitioned index
> > > non-concurrently.  This is undoubtedly a complex operation for DBA,
> > > especially when there are many partitions. 

I added functionality for C-I-C, REINDEX-CONCURRENTLY, and CLUSTER of
partitioned tables.  We already recursively handle VACUUM and ANALYZE since
v10.

And added here:
https://commitfest.postgresql.org/28/2584/

Adger, if you're familiar with compilation and patching, do you want to try the
patch ?

Note, you could do this now using psql like:
SELECT format('CREATE INDEX CONCURRENTLY ... ON %s(col)', a::regclass) FROM pg_partition_ancestors() AS a;
\gexec

-- 
Justin

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Recording test runtimes with the buildfarm
Next
From: Justin Pryzby
Date:
Subject: pg_dump, gzwrite, and errno