From jb@anykey.co.il Wed May 17 00:23:25 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 58B959F9CEE for ; Tue, 16 May 2006 21:23:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 06659-09 for ; Tue, 16 May 2006 21:23:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from server.nextgap2000.com (server.nextgap2000.com [66.98.160.7]) by postgresql.org (Postfix) with ESMTP id 5C4BD9F9C18 for ; Tue, 16 May 2006 21:23:14 -0300 (ADT) Received: from [82.166.55.109] (helo=jonathanlaptop) by server.nextgap2000.com with esmtpa (Exim 4.52) id 1Fg9oj-0004EN-EN for pgsql-performance@postgresql.org; Wed, 17 May 2006 03:23:10 +0300 From: "Jonathan Blitz" To: Subject: Adding and filling new column on big table Date: Wed, 17 May 2006 03:19:26 +0200 Message-ID: <01b401c6794f$f27355e0$ddf71005@jonathanlaptop> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01B5_01C67960.B5FC25E0" X-Mailer: Microsoft Office Outlook 11 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 thread-index: AcZ5T++5mWZOGFRKQDOtEizQgfW9DA== X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextgap2000.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anykey.co.il X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/351 X-Sequence-Number: 19138 This is a multi-part message in MIME format. ------=_NextPart_000_01B5_01C67960.B5FC25E0 Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: quoted-printable I have a table of about 500,000 rows.=20 =20 I need to add a new column and populate it. =20 So, I have tried to run the following command. The command never = finishes (I gave up after about and hour and a half!). Note that none of the columns have indexes. =20 Update mytable set new_column =3D =20 case when column_1 =3D column_2 then 1 =20 when column_1+column_3=3D column_2 and column_3 > 0 then 2 =20 when column_1+column_3+column_4 =3D column_2 and column_4 > 0 then 3 =20 when column_1+column_3+column_4+column_5 =3D column_2 and column_5 > 0 then 4 =20 else 0=20 end =20 =20 My computer is a Pentium 4 =96 2.4 GHZ and 1G RAM =96 so it should be = fast enough. =20 Any ideas? =20 Jonathan Blitz =20 --=20 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: = 05/15/2006 =20 ------=_NextPart_000_01B5_01C67960.B5FC25E0 Content-Type: text/html; charset="windows-1250" Content-Transfer-Encoding: quoted-printable

I have a table of about 500,000 rows. =

 

I need to add a new column and populate = it.

 

So, I have tried to run the following command. The = command never finishes (I gave up after about and hour and a = half!).

Note that none of the columns have = indexes.

 

Update mytable set new_column =3D    =

case when column_1 =3D column_2 =            =             =             =             =             =             then 1  

when column_1+column_3=3D column_2 and column_3 > = 0  =             =             =             then 2  

when column_1+column_3+column_4 =3D column_2 and = column_4 > 0         =             then = 3  

when column_1+column_3+column_4+column_5 =3D column_2 = and column_5 > 0     then 4   =

else =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =             &= nbsp;           &n= bsp;           &nb= sp;          0

end

 

 

My computer is a Pentium 4 – 2.4 GHZ and 1G RAM = – so it should be fast enough.

 

Any ideas?

 

Jonathan Blitz

 


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: = 05/15/2006

------=_NextPart_000_01B5_01C67960.B5FC25E0-- From mike@fuhr.org Wed May 17 02:31:47 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 0DF4A9F9CEE for ; Tue, 16 May 2006 23:31:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 76213-10 for ; Tue, 16 May 2006 23:31:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 52A1F9F9C18 for ; Tue, 16 May 2006 23:31:38 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k4H2VVuP004441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 16 May 2006 20:31:34 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k4H2VVHq060897; Tue, 16 May 2006 20:31:31 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k4H2VVTk060896; Tue, 16 May 2006 20:31:31 -0600 (MDT) (envelope-from mfuhr) Date: Tue, 16 May 2006 20:31:30 -0600 From: Michael Fuhr To: Jonathan Blitz Cc: pgsql-performance@postgresql.org Subject: Re: Adding and filling new column on big table Message-ID: <20060517023130.GA60671@winnie.fuhr.org> References: <01b401c6794f$f27355e0$ddf71005@jonathanlaptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01b401c6794f$f27355e0$ddf71005@jonathanlaptop> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/356 X-Sequence-Number: 19143 On Wed, May 17, 2006 at 03:19:26AM +0200, Jonathan Blitz wrote: > I have a table of about 500,000 rows. > > I need to add a new column and populate it. > > So, I have tried to run the following command. The command never finishes (I > gave up after about and hour and a half!). If you install contrib/pgstattuple you can figure out how fast the update is running. Run "SELECT * FROM pgstattuple('mytable')" a few times and note the rate at which dead_tuple_count is increasing. If it's not increasing at all then query pg_locks and look for locks where "granted" is false. I created a test table, populated it with 500,000 rows of random data, and ran the update you posted. On a 500MHz Pentium III with 512M RAM and a SCSI drive from the mid-to-late 90s, running PostgreSQL 8.1.3 on FreeBSD 6.1, the update finished in just over two minutes. The table had one index (the primary key). > Note that none of the columns have indexes. Do you mean that no columns in the table have indexes? Or that the columns referenced in the update don't have indexes but that other columns do? What does "\d mytable" show? Do other tables have foreign key references to this table? What non-default settings do you have in postgresql.conf? What version of PostgreSQL are you running and on what platform? How busy is the system? What's the output of "EXPLAIN UPDATE mytable ..."? -- Michael Fuhr From lists@stringsutils.com Tue May 30 03:22:52 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 21F019FA2EB for ; Tue, 30 May 2006 00:22:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 09995-10 for ; Tue, 30 May 2006 00:22:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from zoraida.natserv.net (p65-147.acedsl.com [66.114.65.147]) by postgresql.org (Postfix) with ESMTP id 1B4629FA2DB for ; Tue, 30 May 2006 00:22:42 -0300 (ADT) Received: from localhost (localhost.natserv.net [127.0.0.1]) by zoraida.natserv.net (Postfix) with SMTP id 4A4A7B81F for ; Mon, 29 May 2006 23:22:41 -0400 (EDT) Received: from zoraida.natserv.net (localhost.natserv.net [127.0.0.1]) by zoraida.natserv.net (Postfix) with ESMTP id 15DF8B822; Mon, 29 May 2006 23:22:37 -0400 (EDT) Received: from zoraida.natserv.net (zoraida.natserv.net [66.114.65.147]) by zoraida.natserv.net (Postfix) with ESMTP id D9024B81F; Mon, 29 May 2006 23:22:36 -0400 (EDT) References: <01b401c6794f$f27355e0$ddf71005@jonathanlaptop> Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Francisco Reyes To: Jonathan Blitz Cc: pgsql-performance@postgresql.org Subject: Re: Adding and filling new column on big table Date: Mon, 29 May 2006 23:22:36 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-DSPAM-Result: Innocent X-DSPAM-Processed: Mon May 29 23:22:40 2006 X-DSPAM-Confidence: 1.0000 X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 58,447bba80348141151220975 X-DSPAM-Factors: 27, writes+>, 0.40000, Received*Mon+29, 0.40000, Received*Mon+29, 0.40000, Date*May, 0.40000, never, 0.40000, To*anykey.co.il>, 0.40000, Subject*on+big, 0.40000, Content-Type*charset="US, 0.40000, Date*22+36, 0.40000, Received*(zoraida.natserv.net+[66.114.65.147]), 0.40000, Received*ESMTP, 0.40000, Received*ESMTP, 0.40000, Content-Disposition*inline, 0.40000, Jonathan+Blitz, 0.40000, References*<01b401c6794f$f27355e0$ddf71005+jonathanlaptop>, 0.40000, Received*[66.114.65.147]), 0.40000, the+table?, 0.40000, Date*Mon, 0.40000, about, 0.40000, Message-ID*, 0.40000, Received*(zoraida.natserv.net, 0.40000, Subject*new+column, 0.40000, and+a, 0.40000, run+the, 0.40000, and+hour, 0.40000, hour+and, 0.40000, ever, 0.40000 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/518 X-Sequence-Number: 19305 Jonathan Blitz writes: > So, I have tried to run the following command. The command never finishes > (I gave up after about and hour and a half!). Did you ever find what was the problem? Perhaps you needed to run a vacuum full on the table? From jb@anykey.co.il Tue May 30 08:36:20 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 08F869FA5E9 for ; Tue, 30 May 2006 05:36:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 48761-01 for ; Tue, 30 May 2006 05:36:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from server.nextgap2000.com (server.nextgap2000.com [66.98.160.7]) by postgresql.org (Postfix) with ESMTP id 6DD9B9FA317 for ; Tue, 30 May 2006 05:36:09 -0300 (ADT) Received: from 85.64.46.244.dynamic.barak-online.net ([85.64.46.244] helo=jonathanlaptop) by server.nextgap2000.com with esmtpa (Exim 4.52) id 1FkzhF-0005ua-CX; Tue, 30 May 2006 11:35:26 +0300 From: "Jonathan Blitz" To: "'Francisco Reyes'" Cc: Subject: Re: Adding and filling new column on big table Date: Tue, 30 May 2006 11:35:55 +0200 Message-ID: <005701c683cc$7757af00$ddf71005@jonathanlaptop> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 In-reply-to: Thread-Index: AcaDmGicd+uhOzvEQ7y0TIFGt8auewAM9yVQ X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextgap2000.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anykey.co.il X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/520 X-Sequence-Number: 19307 > > So, I have tried to run the following command. The command never finishes > > (I gave up after about and hour and a half!). > > Did you ever find what was the problem? > Perhaps you needed to run a vacuum full on the table? Nope. I just gave up in the end and left it with NULL as the default value. There were, in fact, over 2 million rows in the table rather than 1/4 of a million so that was part of the problem. Jonathan -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.7.4/351 - Release Date: 05/29/2006 From lists@stringsutils.com Tue May 30 15:58:50 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id EE7F29FA61D for ; Tue, 30 May 2006 12:58:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 32859-06 for ; Tue, 30 May 2006 12:58:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from zoraida.natserv.net (p65-147.acedsl.com [66.114.65.147]) by postgresql.org (Postfix) with ESMTP id 304AA9FA5E2 for ; Tue, 30 May 2006 12:58:44 -0300 (ADT) Received: from localhost (localhost.natserv.net [127.0.0.1]) by zoraida.natserv.net (Postfix) with SMTP id 95E11B81F for ; Tue, 30 May 2006 11:58:42 -0400 (EDT) Received: from zoraida.natserv.net (localhost.natserv.net [127.0.0.1]) by zoraida.natserv.net (Postfix) with ESMTP id 05780B822; Tue, 30 May 2006 11:58:39 -0400 (EDT) Received: from zoraida.natserv.net (zoraida.natserv.net [66.114.65.147]) by zoraida.natserv.net (Postfix) with ESMTP id A8EEFB81F; Tue, 30 May 2006 11:58:38 -0400 (EDT) References: <005701c683cc$7757af00$ddf71005@jonathanlaptop> Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Francisco Reyes To: Jonathan Blitz Cc: pgsql-performance@postgresql.org Subject: Re: Adding and filling new column on big table Date: Tue, 30 May 2006 11:58:38 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-DSPAM-Result: Innocent X-DSPAM-Processed: Tue May 30 11:58:42 2006 X-DSPAM-Confidence: 1.0000 X-DSPAM-Probability: 0.0023 X-DSPAM-Signature: 58,447c6bb2348141774319805 X-DSPAM-Factors: 27, writes+>, 0.40000, many, 0.40000, but, 0.40000, That, 0.40000, 4GB, 0.40000, done+a, 0.40000, just, 0.40000, just, 0.40000, Received*2006+11, 0.40000, Received*2006+11, 0.40000, 1/4+of, 0.40000, Date*May, 0.40000, Received*Tue, 0.40000, Received*Tue, 0.40000, Received*A8EEFB81F, 0.40000, Date*38, 0.40000, end, 0.40000, an, 0.40000, record+table, 0.40000, ever?+>, 0.40000, 10, 0.40000, To*anykey.co.il>, 0.40000, opteron+with, 0.40000, record, 0.40000, (SATA), 0.40000, Subject*on+big, 0.40000, of, 0.40000 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/528 X-Sequence-Number: 19315 Jonathan Blitz writes: > I just gave up in the end and left it with NULL as the default value. Could you do the updates in batches instead of trying to do them all at once? Have you done a vacuum full on this table ever? > There were, in fact, over 2 million rows in the table rather than 1/4 of a > million so that was part of the problem. What hardware? I have a dual CPU opteron with 4GB of RAM and 8 disks in RAID 10 (SATA). Doing an update on a 5 million record table took quite a while, but it did fininish. :-) I just did vacuum full before and after though.. That many updates tend to slow down operations on the table aftewards unless you vacuum the table. Based on what you wrote it sounded as if you tried a few times and may have killed the process.. this would certainly slow down the operations on that table unless you did a vacuum full. I wonder if running vacuum analyze against the table as the updates are running would be of any help. From jb@anykey.co.il Tue May 30 16:11:30 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 761CF9FA5E2 for ; Tue, 30 May 2006 13:11:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 34634-07 for ; Tue, 30 May 2006 13:11:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from server.nextgap2000.com (server.nextgap2000.com [66.98.160.7]) by postgresql.org (Postfix) with ESMTP id 83B7B9FA5DD for ; Tue, 30 May 2006 13:11:24 -0300 (ADT) Received: from 85.64.46.244.dynamic.barak-online.net ([85.64.46.244] helo=jonathanlaptop) by server.nextgap2000.com with esmtpa (Exim 4.52) id 1Fl6oM-0006rg-2M; Tue, 30 May 2006 19:11:20 +0300 From: "Jonathan Blitz" To: "'Francisco Reyes'" Cc: Subject: Re: Adding and filling new column on big table Date: Tue, 30 May 2006 19:11:30 +0200 Message-ID: <00d201c6840c$2543eb80$ddf71005@jonathanlaptop> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 In-reply-to: Thread-Index: AcaEAgxu43PlolVPQLuJRPcvUE1A7wACYUGQ X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextgap2000.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anykey.co.il X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/529 X-Sequence-Number: 19316 > > > Could you do the updates in batches instead of trying to do them all at > once? Nope. Didn't think it would make any difference. > > Have you done a vacuum full on this table ever? Many times > > What hardware? > I have a dual CPU opteron with 4GB of RAM and 8 disks in RAID 10 (SATA). > Doing an update on a 5 million record table took quite a while, but it did > fininish. :-) I am using a laptop :). Pentium 4 (not 4M) with 1GB of memory - 2 MHZ Must do it on that since the program is aimed for use at home. Jonathan -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.7.4/351 - Release Date: 05/29/2006 From lists@stringsutils.com Tue May 30 17:25:46 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D2EAD9FA5E9 for ; Tue, 30 May 2006 14:25:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 88708-01 for ; Tue, 30 May 2006 14:25:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from zoraida.natserv.net (p65-147.acedsl.com [66.114.65.147]) by postgresql.org (Postfix) with ESMTP id CCAA59FADD1 for ; Tue, 30 May 2006 14:25:40 -0300 (ADT) Received: from localhost (localhost.natserv.net [127.0.0.1]) by zoraida.natserv.net (Postfix) with SMTP id AADE2B81F for ; Tue, 30 May 2006 13:25:39 -0400 (EDT) Received: from zoraida.natserv.net (localhost.natserv.net [127.0.0.1]) by zoraida.natserv.net (Postfix) with ESMTP id 0A06CB822; Tue, 30 May 2006 13:25:37 -0400 (EDT) Received: from 35st-server.simplicato.com (static-71-249-233-130.nycmny.east.verizon.net [71.249.233.130]) by zoraida.natserv.net (Postfix) with ESMTP id 85AB7B81F; Tue, 30 May 2006 13:25:36 -0400 (EDT) References: <00d201c6840c$2543eb80$ddf71005@jonathanlaptop> Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Francisco Reyes To: Jonathan Blitz Cc: pgsql-performance@postgresql.org Subject: Re: Adding and filling new column on big table Date: Tue, 30 May 2006 13:25:35 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-DSPAM-Result: Innocent X-DSPAM-Processed: Tue May 30 13:25:39 2006 X-DSPAM-Confidence: 0.9899 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 58,447c8013348147593317928 X-DSPAM-Factors: 27, Date*May, 0.01000, Content-Type*charset="US, 0.01000, Received*ESMTP, 0.01000, Received*ESMTP, 0.01000, Content-Disposition*inline, 0.01000, Content-Type*ASCII", 0.01000, Cc*pgsql, 0.01000, Received*zoraida.natserv.net, 0.01000, Received*zoraida.natserv.net, 0.01000, Received*May+2006, 0.01000, Received*May+2006, 0.01000, Date*May+2006, 0.01000, Received*May, 0.01000, Received*May, 0.01000, Received*with, 0.01000, Received*with, 0.01000, X-Mailer*mta.org/cone/, 0.01000, Received*id, 0.01000, Received*id, 0.01000, Received*ESMTP+id, 0.01000, Received*ESMTP+id, 0.01000, Content-Type*charset="US+ASCII", 0.01000, X-Mailer*http, 0.01000, From*Francisco+Reyes, 0.01000, Cc*performance, 0.01000, Received*from+zoraida.natserv.net, 0.01000, Date*0400, 0.01000 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/532 X-Sequence-Number: 19319 Jonathan Blitz writes: > Nope. Didn't think it would make any difference. May be worth a try. > I am using a laptop :). > Pentium 4 (not 4M) with 1GB of memory - 2 MHZ Most laptop drives are only 5,400 RPM which would make a transaction like you are describing likely take a while. > Must do it on that since the program is aimed for use at home. No desktop at home you could try it on? I think the problem with the laptop is likely it's drive. From smarlowe@g2switchworks.com Tue May 30 20:07:30 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 526CC9FADD1 for ; Tue, 30 May 2006 17:07:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 08649-01 for ; Tue, 30 May 2006 17:07:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id D97C39FA5E9 for ; Tue, 30 May 2006 17:07:17 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Tue, 30 May 2006 20:07:15 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 30 May 2006 15:07:15 -0500 Subject: Re: Adding and filling new column on big table From: Scott Marlowe To: Jonathan Blitz Cc: 'Francisco Reyes' , pgsql-performance@postgresql.org In-Reply-To: <012501c6842c$bb8438f0$ddf71005@jonathanlaptop> References: <012501c6842c$bb8438f0$ddf71005@jonathanlaptop> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1149019635.25526.94.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 30 May 2006 15:07:15 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/535 X-Sequence-Number: 19322 On Tue, 2006-05-30 at 16:04, Jonathan Blitz wrote: > > > > Most laptop drives are only 5,400 RPM which would make a transaction like > > you are describing likely take a while. > > Not sure what my one is but it is new(ish). > > > > > No desktop at home you could try it on? > > I think the problem with the laptop is likely it's drive. > > I suppose I could do but I need to install PostgreSQL there and then copy > over the database. Keep in mind, most, if not all IDE drives lie about fsync, so the speed of the drive is a limit only if you're actually writing a lot of data. If you're doing a lot of little transactions, the drive should be lying and holding the data in cache on board, so the speed should be OK. From lists@peufeu.com Tue May 30 20:24:41 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9612D9FADD1 for ; Tue, 30 May 2006 17:24:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 10935-04 for ; Tue, 30 May 2006 17:24:37 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from peufeu.com (boutiquenumerique.com [82.67.9.10]) by postgresql.org (Postfix) with ESMTP id CFD609FA5E9 for ; Tue, 30 May 2006 17:24:36 -0300 (ADT) Received: (qmail 15318 invoked from network); 30 May 2006 22:24:34 +0200 Received: from boutiquenumerique.com (HELO apollo13) (82.67.9.10) by boutiquenumerique.com with SMTP; 30 May 2006 22:24:34 +0200 To: "Jonathan Blitz" , "'Francisco Reyes'" Cc: pgsql-performance@postgresql.org Subject: Re: Adding and filling new column on big table References: <012501c6842c$bb8438f0$ddf71005@jonathanlaptop> Message-ID: Date: Tue, 30 May 2006 22:24:32 +0200 From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <012501c6842c$bb8438f0$ddf71005@jonathanlaptop> User-Agent: Opera M2/8.54 (Linux, build 1745) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/536 X-Sequence-Number: 19323 >> Most laptop drives are only 5,400 RPM which would make a transaction >> like >> you are describing likely take a while. > > Not sure what my one is but it is new(ish). If you're doing data intensive operations (like a big update which looks like what you're doing) it will write many megabytes to the harddrive... my laptop HDD (5400 rpm) does about 15 MB/s throughput while a standard desktop 7200rpm drive does 55-60 MB/s throughput. Plus, seek times on a laptop drive are horrendous. From lists@stringsutils.com Tue May 30 20:52:52 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D0ABE9FAE4E for ; Tue, 30 May 2006 17:52:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 14797-06 for ; Tue, 30 May 2006 17:52:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from zoraida.natserv.net (p65-147.acedsl.com [66.114.65.147]) by postgresql.org (Postfix) with ESMTP id A8B979FA5E9 for ; Tue, 30 May 2006 17:52:41 -0300 (ADT) Received: from localhost (localhost.natserv.net [127.0.0.1]) by zoraida.natserv.net (Postfix) with SMTP id AE65CB81F for ; Tue, 30 May 2006 16:52:36 -0400 (EDT) Received: from zoraida.natserv.net (localhost.natserv.net [127.0.0.1]) by zoraida.natserv.net (Postfix) with ESMTP id C372BB822; Tue, 30 May 2006 16:52:33 -0400 (EDT) Received: from 35st-server.simplicato.com (static-71-249-233-130.nycmny.east.verizon.net [71.249.233.130]) by zoraida.natserv.net (Postfix) with ESMTP id 4ECB0B81F; Tue, 30 May 2006 16:52:33 -0400 (EDT) References: <012501c6842c$bb8438f0$ddf71005@jonathanlaptop> Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Francisco Reyes To: Jonathan Blitz Cc: pgsql-performance@postgresql.org Subject: Re: Adding and filling new column on big table Date: Tue, 30 May 2006 16:52:32 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-DSPAM-Result: Innocent X-DSPAM-Processed: Tue May 30 16:52:36 2006 X-DSPAM-Confidence: 0.9899 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 58,447cb094348141809116389 X-DSPAM-Factors: 27, writes+>, 0.01000, Date*May, 0.01000, To*anykey.co.il>, 0.01000, Subject*on+big, 0.01000, Content-Type*charset="US, 0.01000, Received*ESMTP, 0.01000, Received*ESMTP, 0.01000, Content-Disposition*inline, 0.01000, Jonathan+Blitz, 0.01000, Subject*new+column, 0.01000, writes, 0.01000, Subject*filling, 0.01000, Subject*column+on, 0.01000, Subject*[PERFORM]+Adding, 0.01000, Content-Type*ASCII", 0.01000, Blitz, 0.01000, that, 0.01000, that, 0.01000, Cc*pgsql, 0.01000, Subject*table, 0.01000, Received*zoraida.natserv.net, 0.01000, Received*zoraida.natserv.net, 0.01000, Received*May+2006, 0.01000, Received*May+2006, 0.01000, Date*May+2006, 0.01000, Subject*big+table, 0.01000, Received*May, 0.01000 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/537 X-Sequence-Number: 19324 Jonathan Blitz writes: > I suppose I could do but I need to install PostgreSQL there and then copy > over the database. > Maybe I will give it a try. I really think that is your best bet. If for whatever reason that will not be an option perhaps you can just let the process run over the weekend.. possibly monitor the process from the OS to make sure it is not frozen. Don't recall if you mentioned the OS.. is it any unix like os? If so there are several ways you could check to make sure the process is not frozen such as iostats, top, vmstats(these from FreeBSD, but most unix like os should have tools like those if not some with the same name). From jb@anykey.co.il Tue May 30 20:04:45 2006 X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CCC889FADD1 for ; Tue, 30 May 2006 17:04:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 07792-04 for ; Tue, 30 May 2006 17:04:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from server.nextgap2000.com (server.nextgap2000.com [66.98.160.7]) by postgresql.org (Postfix) with ESMTP id 741209FA5E9 for ; Tue, 30 May 2006 17:04:36 -0300 (ADT) Received: from 85.64.46.244.dynamic.barak-online.net ([85.64.46.244] helo=jonathanlaptop) by server.nextgap2000.com with esmtpa (Exim 4.52) id 1FlAS8-0000VY-OX; Tue, 30 May 2006 23:04:33 +0300 From: "Jonathan Blitz" To: "'Francisco Reyes'" Cc: Subject: Re: Adding and filling new column on big table Date: Tue, 30 May 2006 23:04:48 +0200 Message-ID: <012501c6842c$bb8438f0$ddf71005@jonathanlaptop> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 In-reply-to: Thread-Index: AcaEDi3VMYRf6fz9QLaG7/3TKwkY0wAHhxwQ X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextgap2000.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anykey.co.il X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/534 X-Sequence-Number: 19321 > > Most laptop drives are only 5,400 RPM which would make a transaction like > you are describing likely take a while. Not sure what my one is but it is new(ish). > > No desktop at home you could try it on? > I think the problem with the laptop is likely it's drive. I suppose I could do but I need to install PostgreSQL there and then copy over the database. Maybe I will give it a try. Jonathan -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.7.4/351 - Release Date: 05/29/2006