Re: optimizing large query with IN (...)

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: "Marcus Andree S(dot) Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br>
Subject: Re: optimizing large query with IN (...)
Date: 2004-03-11 00:41:45
Message-ID: 404FB5C9.3060803@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Marcus Andree S. Magalhaes wrote:
> 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' )
>

How often do you update this counter? Each update requires adding a new
row to the table and invalidating the old one. Then the old ones stick
around until the next vacuum.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Joseph Shraibman 2004-03-11 00:43:57 Re: Postgresql on SAN
Previous Message Marty Scholes 2004-03-10 23:29:55 Re: Scaling further up