Re: prepareThreshold=1 and statement.executeBatch() ??

From: Kris Jurka <books(at)ejurka(dot)com>
To: Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl>
Cc: pgsql-jdbc(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: prepareThreshold=1 and statement.executeBatch() ??
Date: 2005-11-13 19:02:22
Message-ID: Pine.BSO.4.61.0511131358050.21873@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-11-13 19:13:35 Re: 8.1 substring bug?
Previous Message Joshua D. Drake 2005-11-13 18:57:59 Re: MERGE vs REPLACE

Browse pgsql-jdbc by date

  From Date Subject
Next Message Assad Jarrahian 2005-11-13 23:56:31 Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]
Previous Message Tom Lane 2005-11-13 16:04:55 Re: prepareThreshold=1 and statement.executeBatch() ??