Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ravi Tammineni <rtammineni(at)partner(dot)aligntech(dot)com>
Cc: Samed YILDIRIM <samed(at)reddoc(dot)net>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?
Date: 2016-08-18 21:48:18
Message-ID: CAKFQuwaBvCEPfGA3DUBS6dKJ7M+ZTpLFRKa=2yL=6pm3Xc9TOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Aug 18, 2016 at 5:19 PM, Ravi Tammineni <
rtammineni(at)partner(dot)aligntech(dot)com> wrote:

> I have to add a new id column to the existing table,
>

You will have to write/create a brand new table file. That will take
time. I suspect that using some combination of views and triggers, and
object renaming, will allow you to put together a custom scheme to do this
with minimal impact on production (though you cannot avoid the I/O, you can
maybe spread it out).

A lot depends on the exact usage pattern of the table in question.

David J.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Esteban Casuscelli 2016-08-19 07:20:47 Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?
Previous Message Ravi Tammineni 2016-08-18 21:19:24 Re: What is the best way to create Primary Key on a large table in Postgresql 9.5?