From: Marcus Andree S. Magalhaes <marcus.magalhaes@vlinfo.com.br>
To: pgsql-performance@postgresql.org
Subject: optimizing large query with IN (...)
Date: Wed, 10 Mar 2004 00:35:15 -0300 (BRT)
Message-ID: <62371.200.174.148.100.1078889715.squirrel@webmail.webnow.com.br> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: marcus.magalhaes@vlinfo.com.br
Subject: Re: optimizing large query with IN (...)
In-Reply-To: <62371.200.174.148.100.1078889715.squirrel@webmail.webnow.com.br>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox