From: Alex Balashov <abalashov@evaristesys.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Adding Column on Huge Table
Date: Tue, 19 Mar 2019 16:52:51 -0400
Message-ID: <20190319205251.GC2983@typhoon> (raw)
In-Reply-To: <5b26ed21-a7b5-6c1b-af10-10df4d44a4f7@gmail.com>
References: <HK0PR03MB2977B9460C4CC7D0383D05BDAD400@HK0PR03MB2977.apcprd03.prod.outlook.com>
<5b26ed21-a7b5-6c1b-af10-10df4d44a4f7@gmail.com>
My experience is that adding a column is a rather quick operation even
on quite large tables, _unless_ the column has a default value, in which
case that default value is set for every row. In that case, the time
required for the operation converges with that of a mass-UPDATE.
On Tue, Mar 19, 2019 at 09:53:16PM +0100, Andrzej Zawadzki wrote:
> On 19.03.2019 16:56, Moin Akther wrote:
>
> Dear Experts,
>
> 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 ?
>
>
> No offense, but don't you have any test environment?
>
> Try that or maybe you have so show times.
>
>
> --
>
> Andrzej Zawadzki
>
--
Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.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: abalashov@evaristesys.com, pgsql-admin@lists.postgresql.org
Subject: Re: Adding Column on Huge Table
In-Reply-To: <20190319205251.GC2983@typhoon>
* 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