Re: Replacing a simple nested query? - Mailing list pgsql-sql

From Joe Conway
Subject Re: Replacing a simple nested query?
Date
Msg-id 3F11D6A9.4040905@joeconway.com
Whole thread Raw
In response to Replacing a simple nested query?  (Steve Wampler <swampler@noao.edu>)
List pgsql-sql
Steve Wampler wrote:
> I've got a simple nested query:
> 
>   select * from attributes where id in (select id from
>      attributes where (name='obsid') and (value='oid00066'));
> 
> that performs abysmally.  I've heard this described as the
> 'classic WHERE IN' problem.

I may be missing something, but why can't you just do:  select * from attributes where name='obsid' and
value='oid00066';
?

Joe



pgsql-sql by date:

Previous
From: Steve Wampler
Date:
Subject: Replacing a simple nested query?
Next
From: Steve Wampler
Date:
Subject: Re: Replacing a simple nested query?