Received: from paradigm.webvision.com (paradigm.webvision.com [206.156.252.66]) by hub.org (8.8.8/8.7.5) with SMTP id NAA25083 for ; Thu, 11 Jun 1998 13:07:44 -0400 (EDT) Received: by paradigm.webvision.com (940816.SGI.8.6.9/940406.SGI) id KAA18099; Thu, 11 Jun 1998 10:06:19 -0700 Date: Thu, 11 Jun 1998 10:06:19 -0700 Message-Id: <199806111706.KAA18099@paradigm.webvision.com> From: dave madden To: gyurika@prolan.hu CC: pgsql-sql@postgreSQL.org In-reply-to: <357FDB21.43776016@prolan.hu> (message from Lendvary Gyorgy on Thu, 11 Jun 1998 15:26:57 +0200) Subject: Re: [SQL] update by one transaction =>From: Lendvary Gyorgy =>... =>PQexec(conn, "BEGIN"); =>for (i=0; i<10000; i++) =>{ => sprintf(buff, "UPDATE boci SET col3 = %f WHERE row_number=%d", =>array[i], i); => PQexec(conn, buff); =>} =>PQexec(conn, "END"); => =>This program is very, very slow. The first thing I'd check is that you have an index on boci(row_number). If you do, or if adding one doesn't help, then perhaps you could split boci into two tables: boci1( row_number int, col2 float ) boci2( row_number int, col3 float ) Then you could use the COPY command to load data from your array. To select things, just join boci1 and boci2 on row_number (or create a view, if PostgreSQL supports 'em). d.