Re: how to create index concurrently on partitioned table

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: how to create index concurrently on partitioned table
Дата
Msg-id 20200612072017.GE3362@paquier.xyz
обсуждение исходный текст
Ответ на Re: how to create index concurrently on partitioned table  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: how to create index concurrently on partitioned table  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
On Thu, Jun 11, 2020 at 10:35:02AM -0500, Justin Pryzby wrote:
> 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

I have skimmed quickly through the patch set, and something has caught
my attention.

>  drop table idxpart;
> --- Some unsupported features
> +-- CIC on partitioned table
>  create table idxpart (a int, b int, c text) partition by range (a);
>  create table idxpart1 partition of idxpart for values from (0) to (10);
>  create index concurrently on idxpart (a);
> -ERROR:  cannot create index on partitioned table "idxpart" concurrently
> +\d idxpart1

When it comes to test behaviors specific to partitioning, there are in
my experience three things to be careful about and stress in the tests:
- Use at least two layers of partitioning.
- Include into the partition tree a partition that has no leaf
partitions.
- Test the commands on the top-most parent, a member in the middle of
the partition tree, the partition with no leaves, and one leaf, making
sure that relfilenode changes where it should and that partition trees
remain intact (you can use pg_partition_tree() for that.)

That's to say that the amount of regression tests added here is not
sufficient in my opinion.
--
Michael

Вложения

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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: Internal key management system
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Make more use of RELKIND_HAS_STORAGE()