Re: how to create index concurrently on paritioned table

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: how to create index concurrently on paritioned table
Дата
Msg-id 20200607180448.GL22473@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  (Justin Pryzby <pryzby@telsasoft.com>)
回复:how to create index concurrently on paritioned table  ("李杰(慎追)" <adger.lj@alibaba-inc.com>)
Список pgsql-hackers
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
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.

I said that but I was actually thinking about the code for "REINDEX
CONCURRENTLY" (which should also handle partitioned tables).

I looked at CIC now and came up with the attached.  All that's needed to allow
this case is to close the relation before recursing to partitions - it needs to
be closed before calling CommitTransactionCommand().  There's probably a better
way to write this, but I can't see that there's anything complicated about
handling partitioned tables.

-- 
Justin

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Debian Sid broke Perl
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line