optimizing large query with IN (...)

Поиск
Список
Период
Сортировка
От Marcus Andree S. Magalhaes
Тема optimizing large query with IN (...)
Дата
Msg-id 62371.200.174.148.100.1078889715.squirrel@webmail.webnow.com.br
обсуждение исходный текст
Ответы Re: optimizing large query with IN (...)  (Steve Atkins <steve@blighty.com>)
Re: optimizing large query with IN (...)  ("scott.marlowe" <scott.marlowe@ihs.com>)
Re: optimizing large query with IN (...)  (Joseph Shraibman <jks@selectacast.net>)
Список pgsql-performance
Guys,

I got a Java program to tune. It connects to a 7.4.1 postgresql server
running Linux using JDBC.

The program needs to update a counter on a somewhat large number of
rows, about 1200 on a ~130k rows table. The query is something like
the following:

UPDATE table SET table.par = table.par + 1
WHERE table.key IN ('value1', 'value2', ... , 'value1200' )

This query runs on a  transaction (by issuing  a call to
setAutoCommit(false)) and a commit() right after the query
is sent to the backend.

The process of committing and updating the values is painfully slow
(no surprises here). Any ideas?

Thanks.



В списке pgsql-performance по дате отправления:

Предыдущее
От: Stephen Robert Norris
Дата:
Сообщение: Re: [ADMIN] syslog slowing the database?
Следующее
От: "Eric Jain"
Дата:
Сообщение: Re: optimizing large query with IN (...)