very slow updates - Mailing list pgsql-general

From Xavier Bugaud
Subject very slow updates
Date
Msg-id A4AAC8CD87A2D511B796004005420B1F64CED3@PMSERVER
Whole thread Raw
Responses Re: very slow updates
List pgsql-general
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);

And it takes around 2 minutes !!! (Using ODBC, it also takes around 2
minutes)

I tried to VACUUM the database just before the update, but it doesn't speed
up the process...

If I duplicate my table and I run several times my aplication again, here
are the results :
1 - 11"
2 - 12"
3 - 14"
4 - 15"
5 - 16"
6 - 19"
7 - 1'15"
8 - 1'58"
9 - 1'45"
10- 1'57"
(from this point, it stays around 2 minutes)


Thank you for your help.

Regards,

Xavier Bugaud


pgsql-general by date:

Previous
From: Haroldo Stenger
Date:
Subject: Re: Case Tool
Next
From: Martijn van Oosterhout
Date:
Subject: Re: very slow updates