Re: Speeding up adding fky on a very large table

Поиск
Список
Период
Сортировка
От Ron
Тема Re: Speeding up adding fky on a very large table
Дата
Msg-id 63222285-dfc6-1937-8e4e-600543f370f8@gmail.com
обсуждение исходный текст
Ответ на Speeding up adding fky on a very large table  (Ravi Krishna <s_ravikrishna@aol.com>)
Ответы Re: Speeding up adding fky on a very large table  (Ravi Krishna <s_ravikrishna@aol.com>)
Список pgsql-general
On 10/19/22 08:31, Ravi Krishna wrote:
AWS Aurora based on PG 13.


Large partitioned table of 5+ billion rows and 7TB in size.

ALTER TABLE abc ADD CONSTRAINT fk_123 FOREIGN KEY (a,b,c) REFERENCES xyz(1,2,3);

It seems this is not parallelized. Is there a way. Or directly going into each partition is the only way ( not even sure it is possible).

In vanilla Postgresql (including RDS Postgresql) you can add the FK to each partition and then ALTER TABLE ONLY the parent table.

Don't know about Aurora, though.

--
Angular momentum makes the world go 'round.

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

Предыдущее
От: Ron
Дата:
Сообщение: Re: COMMIT IN STORED PROCEDURE WHILE IN A LOOP
Следующее
От: Ron
Дата:
Сообщение: Re: How to store "blobs" efficiently for small and large sizes, with random access