Re: very slow updates

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Xavier Bugaud <xavier(dot)bugaud(at)parabolemaurice(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: very slow updates
Date: 2002-08-01 06:33:02
Message-ID: 20020801163302.A16316@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Xavier Bugaud 2002-08-01 07:31:17 FW: very slow updates
Previous Message Xavier Bugaud 2002-08-01 05:41:39 very slow updates