Re: add column with default value is very slow - Mailing list pgsql-performance

From Andrew Dunstan
Subject Re: add column with default value is very slow
Date
Msg-id 504F4588.7030900@dunslane.net
Whole thread Raw
In response to Re: add column with default value is very slow  (AI Rumman <rummandba@gmail.com>)
List pgsql-performance
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




pgsql-performance by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: add column with default value is very slow
Next
From: Tom Lane
Date:
Subject: Re: Planner selects different execution plans depending on limit