Subselects and Indices

Поиск
Список
Период
Сортировка
От Andre Schubert
Тема Subselects and Indices
Дата
Msg-id 3C4C1FC3.1EDD1034@kabeljournal.de
обсуждение исходный текст
Список pgsql-admin
Hi,

i have a simple question on indices and subselects.
Lets say i have a table foo with a column id int8 as primary_key bar.
If i do a

select * from foo where id = 10 then the index bar is used.

if i do
select * from foo where id in (10,20) then the index is used.

but if id do
select * from foo where id in ( select 10 ) then the index is not used.

Can anyone explain me this. It is very important, because i have to do
this subselect.

thanks, as

В списке pgsql-admin по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Performance
Следующее
От: Ferdinand Smit
Дата:
Сообщение: Re: Character problems