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

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: prepareThreshold=1 and statement.executeBatch() ??
Дата
Msg-id Pine.BSO.4.61.0511131358050.21873@leary.csoft.net
обсуждение исходный текст
Ответ на Re: prepareThreshold=1 and statement.executeBatch() ??  ("Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: prepareThreshold=1 and statement.executeBatch() ??
Следующее
От: Assad Jarrahian
Дата:
Сообщение: Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]