Re: Replacing a simple nested query?

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Replacing a simple nested query?
Дата
Msg-id 3F11D6A9.4040905@joeconway.com
обсуждение исходный текст
Ответ на Replacing a simple nested query?  (Steve Wampler <swampler@noao.edu>)
Список 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 по дате отправления:

Предыдущее
От: Steve Wampler
Дата:
Сообщение: Replacing a simple nested query?
Следующее
От: Steve Wampler
Дата:
Сообщение: Re: Replacing a simple nested query?