pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: AI Rumman <rummandba@gmail.com>
Cc: depesz@depesz.com
Cc: pgsql-performance@postgresql.org
Subject: Re: add column with default value is very slow
Date: Tue, 11 Sep 2012 10:07:04 -0400
Message-ID: <504F4588.7030900@dunslane.net> (raw)
In-Reply-To: <CAGoODpeorc_7U57NYKsf68Gd3wi9VM+=2kJDZ=89Tk=J=XE=pg@mail.gmail.com>
References: <CAGoODpdBTkhXDuOQDLxuEJYrWfsZZCi_tkjgzDyzPRGDHeQ9ag@mail.gmail.com>
	<20120911134425.GA27828@depesz.com>
	<CAGoODpeorc_7U57NYKsf68Gd3wi9VM+=2kJDZ=89Tk=J=XE=pg@mail.gmail.com>


On 09/11/2012 09:55 AM, AI Rumman wrote:
> I added the excel file for locks data.
> I was surprised to see that while I was updating a single column value 
> for all records in a tables, all indexes are locked by the server.


Any ALTER TABLE command locks the whole table in ACCESS EXCLUSIVE mode, 
indexes included. See the description of ACCESS EXCLUSIVE lock at 
<http://www.postgresql.org/docs/current/static/explicit-locking.html;

cheers

andrew






view thread (8+ messages)

Message-ID: <504F4588.7030900@dunslane.net>
Permalink:  ../504F4588.7030900@dunslane.net/
Also on:    postgresql.org/message-id/504F4588.7030900@dunslane.net

 · 

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: andrew@dunslane.net, rummandba@gmail.com, depesz@depesz.com
  Subject: Re: add column with default value is very slow
  In-Reply-To: <504F4588.7030900@dunslane.net>

* 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