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

From Bryce Nesbitt
Subject Very slow updates when using IN syntax subselect
Date
Msg-id 43ECFF0B.80905@obviously.com
Whole thread Raw
Responses Re: Very slow updates when using IN syntax subselect  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
If I do:   select event_id from event join token using                   (token_number) where token_status=50 and
reconciled=false limit 1;
Then:   update event set reconciled=true where event_id={XXX};


It returns in about a second, or less.  But If I do the same thing with
the IN syntax:
   update event set reconciled=true where event_id in   (select event_id from event join token using (token_number)
wheretoken_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.  Any clues what might be going on?  Help would be much
appreciated.  I'm not seeing this on all my DB's... just the important ones.

PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3
20030502 (Red Hat Linux 3.2.3-20)



pgsql-sql by date:

Previous
From: Osvaldo Rosário Kussama
Date:
Subject: Re: date
Next
From: Chris Browne
Date:
Subject: Re: unique constraint instead of primary key? what