Re: Very slow updates when using IN syntax subselect

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bryce Nesbitt <bryce1(at)obviously(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Very slow updates when using IN syntax subselect
Date: 2006-02-10 21:32:56
Message-ID: 1682.1139607176@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bryce Nesbitt <bryce1(at)obviously(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Nalin Bakshi 2006-02-11 04:18:04 Postgres for Dummies - a new request
Previous Message Bryce Nesbitt 2006-02-10 21:00:59 Very slow updates when using IN syntax subselect