Re: Adding Column on Huge Table

From: Alex Balashov <abalashov(at)evaristesys(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Adding Column on Huge Table
Date: 2019-03-19 20:52:51
Message-ID: 20190319205251.GC2983@typhoon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Andrzej Zawadzki 2019-03-19 20:53:16 Re: Adding Column on Huge Table
Previous Message Laurenz Albe 2019-03-19 17:02:19 Re: Adding Column on Huge Table