Re: how to create index concurrently on paritioned table

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: how to create index concurrently on paritioned table
Дата
Msg-id 20200606142332.GH22473@telsasoft.com
обсуждение исходный текст
Ответ на how to create index concurrently on paritioned table  ("李杰(慎追)" <adger.lj@alibaba-inc.com>)
Ответы Re: how to create index concurrently on paritioned table  (Justin Pryzby <pryzby@telsasoft.com>)
回复:how to create index concurrently on paritioned table  ("李杰(慎追)" <adger.lj@alibaba-inc.com>)
Список pgsql-hackers
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
partitionedindex non-concurrently. 
 
> This is undoubtedly a complex operation for DBA, especially when there are many partitions. 

> Therefore, I wonder why pg does not support concurrent index creation on partitioned tables? 
> What are the difficulties of this function? 
> If I want to implement it, what should I pay attention?

Maybe I'm wrong, but I don't think there's any known difficulty - just that
nobody did it yet.  You should pay attention to what happens on error, but
hopefully you wouldn't need to add much code and can rely on existing code to
paths to handle that right.

I think you'd look at the commits and code implementing indexes on partitioned
tables and CREATE INDEX CONCURRENTLY.  And maybe any following commits with
fixes.

You'd first loop around all children (recursively if there are partitions which
are themselves partitioned) and create indexes concurrently.  

-- 
Justin



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

Предыдущее
От: Dmitry Dolgov
Дата:
Сообщение: Re: [PATCH] Keeps tracking the uniqueness with UniqueKey
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: psql - add SHOW_ALL_RESULTS option