Re: very slow updates

From: Xavier Bugaud <xavier(dot)bugaud(at)parabolemaurice(dot)com>
To: "'g(dot)hintermayer(at)inode(dot)at'" <g(dot)hintermayer(at)inode(dot)at>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: very slow updates
Date: 2002-08-02 08:18:36
Message-ID: A4AAC8CD87A2D511B796004005420B1F64CEE1@PMSERVER
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > Here is the point :
> > Using JDBC, I update one column for all the 1600 rows of a table (10
> > columns) : I'm running 1600 times a query like this :
> > for (i=0 ; i<1600 ; i++)
> > rs2.executeUpdate("UPDATE my_table SET my_date=now() WHERE id="+i);
>
> Why 1600 updates, when you could do it in one ? Either use no where
> clause (if you're really want to update all rows) or use "id>=0 AND
> id<1600" as where clause.

Of course, I simplified my real problem in this (stupid) query...
In my production environement, I don't update all the rows hence the WHERE
clause.

> Gerhard

--
Xavier Bugaud

Browse pgsql-general by date

  From Date Subject
Next Message Karel Zak 2002-08-02 08:26:36 Re: getpid() function
Previous Message Jean-Christian Imbeault 2002-08-02 08:14:58 Referential integrity with primary key spanning multiple columns?