Re: Very slow updates when using IN syntax subselect - Mailing list pgsql-sql

From Tom Lane
Subject Re: Very slow updates when using IN syntax subselect
Date
Msg-id 1682.1139607176@sss.pgh.pa.us
Whole thread Raw
In response to Very slow updates when using IN syntax subselect  (Bryce Nesbitt <bryce1@obviously.com>)
Responses Re: Very slow updates when using IN syntax subselect  (Bryce Nesbitt <bryce1@obviously.com>)
List pgsql-sql
Bryce Nesbitt <bryce1@obviously.com> writes:
>     update event set reconciled=true where event_id in
>     (select event_id from event join token using (token_number)
>      where token_status=50 and reconciled=false LIMIT 1);

> On a 4 CPU machine, 2 CPU's peg at 100%, and the request just eats CPU
> forever.

What does EXPLAIN show for this and for the base query?

> PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3

This may be your problem right here.  You are urgently in need of an
update in any case --- there are a lot of nasty bugs fixed since 7.4.1:
http://developer.postgresql.org/docs/postgres/release.html
        regards, tom lane


pgsql-sql by date:

Previous
From: Chris Browne
Date:
Subject: Re: unique constraint instead of primary key? what
Next
From: Bryce Nesbitt
Date:
Subject: Re: Very slow updates when using IN syntax subselect