Re: how to create index concurrently on partitioned table

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: how to create index concurrently on partitioned table
Дата
Msg-id 20200611153502.GT14879@telsasoft.com
обсуждение исходный текст
Ответ на Re: how to create index concurrently on paritioned table  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: how to create index concurrently on partitioned table  (Michael Paquier <michael@paquier.xyz>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Recording test runtimes with the buildfarm
Следующее
От: Justin Pryzby
Дата:
Сообщение: pg_dump, gzwrite, and errno