Re: prepareThreshold=1 and statement.executeBatch() ?? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: prepareThreshold=1 and statement.executeBatch() ??
Date
Msg-id Pine.BSO.4.61.0511131358050.21873@leary.csoft.net
Whole thread Raw
In response to Re: prepareThreshold=1 and statement.executeBatch() ??  ("Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl>)
List pgsql-jdbc

On Sun, 13 Nov 2005, Joost Kraaijeveld wrote:

> You have tested this with an insert statement. Could you do that also
> for an update (or try to tell me how I can do that)? I am getting very
> strange differences in running time between inserts and update ( 260000
> inserts are measured in seconds, 260000 updates over 1 column in the
> same table are measured in minutes)
>

Certainly there are different costs associated with inserts vs. updates.
An insert just needs to jam a new row in somewhere, but the update must
first search the table to find the existing row.  If you do not have an
index this will take a while.  If you update the same row every time this
will also take a while because you'll be creating a whole bunch of dead
rows in the table.  Some more information on the table and type of updates
could bring the update cost down, but comparing insert vs. update times is
not a reasonable thing to do.

Kris Jurka


pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: prepareThreshold=1 and statement.executeBatch() ??
Next
From: Assad Jarrahian
Date:
Subject: Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]