Skip site navigation (1) Skip section navigation (2)

Re: add column with default value is very slow

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: AI Rumman <rummandba(at)gmail(dot)com>
Cc: depesz(at)depesz(dot)com, pgsql-performance(at)postgresql(dot)org
Subject: Re: add column with default value is very slow
Date: 2012-09-11 14:07:04
Message-ID: 504F4588.7030900@dunslane.net (view raw or flat)
Thread:
Lists: 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




In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2012-09-11 17:19:26
Subject: Re: Planner selects different execution plans depending on limit
Previous:From: hubert depesz lubaczewskiDate: 2012-09-11 14:05:54
Subject: Re: add column with default value is very slow

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group