very slow updates

From: Xavier Bugaud <xavier(dot)bugaud(at)parabolemaurice(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: very slow updates
Date: 2002-08-01 05:41:39
Message-ID: A4AAC8CD87A2D511B796004005420B1F64CED3@PMSERVER
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-08-01 06:33:02 Re: very slow updates
Previous Message Haroldo Stenger 2002-08-01 03:49:30 Re: Case Tool