Thread: Adding a column

Adding a column

From
Bob Pawley
Date:
Any thoughts on why dynamically adding a column to a table would require a run time of 24,000 + milliseconds??
 
Adding a serial column to three tables requires almost 100,000 ms.
 
Bob Pawley

Re: Adding a column

From
Tom Lane
Date:
Bob Pawley <rjpawley@shaw.ca> writes:
> Any thoughts on why dynamically adding a column to a table would require =
> a run time of 24,000 + milliseconds??

Updating all the rows to store the default value, no doubt.  See
http://developer.postgresql.org/pgdocs/postgres/ddl-alter.html
especially the tip under 5.5.1.

            regards, tom lane