From: Ravi Krishna <s_ravikrishna@aol.com>
To: ronljohnsonjr@gmail.com
To: pgsql-general@lists.postgresql.org
Subject: Re: Speeding up adding fky on a very large table
Date: Wed, 19 Oct 2022 20:44:53 +0000 (UTC)
Message-ID: <726737233.489080.1666212293670@mail.yahoo.com> (raw)
In-Reply-To: <63222285-dfc6-1937-8e4e-600543f370f8@gmail.com>
References: <1365946824.316128.1666186309386.ref@mail.yahoo.com>
<1365946824.316128.1666186309386@mail.yahoo.com>
<63222285-dfc6-1937-8e4e-600543f370f8@gmail.com>
Our issue is that it takes 20hrs to index the full table. Hopefully we can add FK in multiple child partitions concurrently, otherwise doing it per partition offers no advantage from performance pov.
Need to test. Hopefully PG should not lock the referred table during the first build, stopping concurrent execution of other partitions.
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: s_ravikrishna@aol.com, ronljohnsonjr@gmail.com
Subject: Re: Speeding up adding fky on a very large table
In-Reply-To: <726737233.489080.1666212293670@mail.yahoo.com>
References: <1365946824.316128.1666186309386.ref@mail.yahoo.com> <1365946824.316128.1666186309386@mail.yahoo.com> <63222285-dfc6-1937-8e4e-600543f370f8@gmail.com> <726737233.489080.1666212293670@mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox