pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: AI Rumman <rummandba@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: add column with default value is very slow
Date: Tue, 11 Sep 2012 15:44:25 +0200
Message-ID: <20120911134425.GA27828@depesz.com> (raw)
In-Reply-To: <CAGoODpdBTkhXDuOQDLxuEJYrWfsZZCi_tkjgzDyzPRGDHeQ9ag@mail.gmail.com>
References: <CAGoODpdBTkhXDuOQDLxuEJYrWfsZZCi_tkjgzDyzPRGDHeQ9ag@mail.gmail.com>

On Tue, Sep 11, 2012 at 07:20:28PM +0600, AI Rumman wrote:
> I have a table as follows:
> I execued the query:
> ALTER TABLE entity ADD COLUMN owner_type char(1) NOT NULL default 'U';
> 
> The db is stuck. The enity table has 2064740 records;

such alter table has to rewrite whole table. So it will take a while

> Watching locks:

output of this was perfectly unreadable, because your email client
wrapped lines at some random places.

In future - please put such dumps on some paste site, or just attach it
to mail, and not copy/paste them to body of message.

Best regards,

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/




view thread (8+ messages)  latest in thread

Message-ID: <20120911134425.GA27828@depesz.com>
Permalink:  ../20120911134425.GA27828@depesz.com/
Also on:    postgresql.org/message-id/20120911134425.GA27828@depesz.com

 · 

reply

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-performance@postgresql.org
  Cc: depesz@depesz.com, rummandba@gmail.com
  Subject: Re: add column with default value is very slow
  In-Reply-To: <20120911134425.GA27828@depesz.com>

* 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