Re: Adding Column on Huge Table - Mailing list pgsql-admin

From Alex Balashov
Subject Re: Adding Column on Huge Table
Date
Msg-id 20190319205251.GC2983@typhoon
Whole thread Raw
In response to Adding Column on Huge Table  (Moin Akther <moindba@hotmail.com>)
Responses Re: Adding Column on Huge Table
List pgsql-admin
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/


pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Adding Column on Huge Table
Next
From: Thomas Kellerer
Date:
Subject: Re: Adding Column on Huge Table