Re: very slow updates - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: very slow updates
Date
Msg-id 20020801163302.A16316@svana.org
Whole thread Raw
In response to very slow updates  (Xavier Bugaud <xavier.bugaud@parabolemaurice.com>)
List pgsql-general
On Thu, Aug 01, 2002 at 09:41:39AM +0400, Xavier Bugaud wrote:
> Hi,
>
> I'm running PostgreSQL 7.2.1 with a redhat 7.2 box (PIII 800 / 256MB RAM /
> RAID1 IDE : promise TX2000).
> I'm new to Postgres, so perhaps I missed something...
>
> 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);

1. Are you using transactions?
2. Do you have an index on id?

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

pgsql-general by date:

Previous
From: Xavier Bugaud
Date:
Subject: very slow updates
Next
From: Xavier Bugaud
Date:
Subject: FW: very slow updates