From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Moin Akther <moindba@hotmail.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Adding Column on Huge Table
Date: Tue, 19 Mar 2019 18:02:19 +0100
Message-ID: <6fff7b00a759e89f6468757602ac752c8d4ffdfc.camel@cybertec.at> (raw)
In-Reply-To: <HK0PR03MB2977B9460C4CC7D0383D05BDAD400@HK0PR03MB2977.apcprd03.prod.outlook.com>
References: <HK0PR03MB2977B9460C4CC7D0383D05BDAD400@HK0PR03MB2977.apcprd03.prod.outlook.com>
Moin Akther wrote:
> We want to add a column on table size of 1.5TB, we have to perform this activity with minimal downtime.
>
> What are the best practises to add a column on huge table ?
>
> How much time alter statement will take to add column ?
>
> Any alternate solution other than alter statement to add column ?
>
> Will adding a new column on a huge table generate huge WAL files ?
As a quick experiment would have told you, adding a column without a DEFAULT
clause is very fast. Since v11, it is fast even if the new column has a
DEFAULT clause.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: laurenz.albe@cybertec.at, moindba@hotmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Adding Column on Huge Table
In-Reply-To: <6fff7b00a759e89f6468757602ac752c8d4ffdfc.camel@cybertec.at>
* 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