index not used with subselect in where clause ?
От | Christian Fritze |
---|---|
Тема | index not used with subselect in where clause ? |
Дата | |
Msg-id | 200104161720.TAA03534@chatsubo.sprawl.de обсуждение исходный текст |
Ответы |
Re: index not used with subselect in where clause ?
|
Список | pgsql-general |
Good evening (GMT+0200) everybody... I have a table with an indexed integer attribute used to determine which rows to fetch from my data base. (pgsql version is 7.1RC4) When doing a SELECT attr1 FROM table1 WHERE attr1 IN (<list of ints>) AND <more conditions>; where <list of ints> is entered explicitly (or generated by a program) everything works fine and fast using the index on attr1. But when I try doing a SELECT attr1 FROM table1 WHERE attr1 IN (<SUBSELECT returning list of ints>) AND <more conditions>; then the SELECT on table1 uses a sequential scan running 'endlessly'. Is this really how it's meant to be? If so, why? If not, how can I get the second version working??? Thanks in advance... Christian -- "The sky above the port was the color of television, tuned to a dead channel." -- W.G. --
В списке pgsql-general по дате отправления: