pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dave madden <dhm@paradigm.webvision.com>
To: gyurika@prolan.hu
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] update by one transaction
Date: Thu, 11 Jun 1998 10:06:19 -0700
Message-ID: <199806111706.KAA18099@paradigm.webvision.com> (raw)
In-Reply-To: <357FDB21.43776016@prolan.hu>

 =>From: Lendvary Gyorgy <gyurika@prolan.hu>
 =>...
 =>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.



view thread (4+ messages)

Message-ID: <199806111706.KAA18099@paradigm.webvision.com>
Permalink:  ../199806111706.KAA18099@paradigm.webvision.com/
Also on:    postgresql.org/message-id/199806111706.KAA18099@paradigm.webvision.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: dhm@paradigm.webvision.com, gyurika@prolan.hu
  Subject: Re: [SQL] update by one transaction
  In-Reply-To: <199806111706.KAA18099@paradigm.webvision.com>
  References: <357FDB21.43776016@prolan.hu> <199806111706.KAA18099@paradigm.webvision.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox