Re: Another sub-select problem...

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: Another sub-select problem...
Дата
Msg-id 1053651383.279.19.camel@jester
обсуждение исходный текст
Ответ на Another sub-select problem...  (Kevin Ready <kevin@meridianis.com>)
Список pgsql-sql
> AND blockID IN (SELECT blockid FROM block WHERE parent_component_classid
> IN(8,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,
> 46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,
> 71,72,73,75,76,77,78,79,80,81,82,83,84,85,86,88,117,133,143,145,146,178,188,
> 193,197)

Have you tried the above in the EXISTS form?

AND EXISTS (SELECT TRUE FROM block WHERE parent_component_classid IN
(<list>) AND blockid = row.blockid)

Exists as shown above will probably be significantly faster for 7.3 and
prior if parent_component_classid.blockid is indexed.  In 7.4 you may
wish to try the IN style again, as there is a chance it'll be right.

--
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: tablename as attribute in pgplsql
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Another sub-select problem...