Thread: JDBC Performance
I am having some performance problems with postgresql and JDBC when it comes to updates. If I try and update a record it seems to be taking 1.7 seconds for 100 records or 14 seconds for 500 records. An insert is only taking between 3-5 ms/record. Performance on the updates continue to decrease until I vacuum analyze the database again. Is this normal? Mike
Doesn't sound normal! Can you post the schema for the table you are updating pg_dump -s -t tablename dbname One thing you can try if you are doing bulk updates is to drop the index before the update, and create it again afterwards Dave -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of mike@mwcs.mb.ca Sent: July 31, 2001 4:01 PM To: pgsql-jdbc@postgresql.org Subject: [JDBC] JDBC Performance I am having some performance problems with postgresql and JDBC when it comes to updates. If I try and update a record it seems to be taking 1.7 seconds for 100 records or 14 seconds for 500 records. An insert is only taking between 3-5 ms/record. Performance on the updates continue to decrease until I vacuum analyze the database again. Is this normal? Mike ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
This is typical. Until you do a vacuum the old versions of a row are still in the db, so an update has to do an index query on an index to get to the row that needs indexing, which returns a lot of pointers to old entries, that then have to be tranversed until the valid one in found. Then the update makes one more invalid row. mike@mwcs.mb.ca wrote: > I am having some performance problems with postgresql and JDBC when it > comes to updates. If I try and update a record it seems to be taking 1.7 > seconds for 100 records or 14 seconds for 500 records. An insert is only > taking between 3-5 ms/record. Performance on the updates continue to > decrease until I vacuum analyze the database again. Is this normal? > > Mike > > > > -- Joseph Shraibman jks@selectacast.net Increase signal to noise ratio. http://www.targabot.com