Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TBR6C-0000bd-SE for pgsql-performance@postgresql.org; Tue, 11 Sep 2012 14:05:57 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TBR6B-0000Ta-Sp for pgsql-performance@postgresql.org; Tue, 11 Sep 2012 14:05:56 +0000 Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by depesz.com with esmtpa (Exim 4.80) (envelope-from ) id 1TBR6A-0002js-Vy; Tue, 11 Sep 2012 16:05:55 +0200 Date: Tue, 11 Sep 2012 16:05:54 +0200 From: hubert depesz lubaczewski To: AI Rumman Cc: pgsql-performance@postgresql.org Subject: Re: add column with default value is very slow Message-ID: <20120911140554.GA8922@depesz.com> Reply-To: depesz@depesz.com References: <20120911134425.GA27828@depesz.com> <20120911135939.GA1656@depesz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.2 (--) X-Archive-Number: 201209/43 X-Sequence-Number: 47789 On Tue, Sep 11, 2012 at 08:04:06PM +0600, AI Rumman wrote: > Table size is 1186 MB. if it takes long, it just means that your IO is slow. > I split the command in three steps as you said, but the result same during > the update operation. three? I was showing four steps, and one of them is usually consisting hundreds, if not thousands, of queries. > One more thing, I have just restored the db from dump and analyzed it and > I am using Postgresql 9.1 with 3 GB Ram with dual core machine. so it looks like your IO channel is slow. Best regards, depesz -- The best thing about modern society is how easy it is to avoid contact with it. http://depesz.com/