Re:

Поиск
Список
Период
Сортировка
От Haller Christoph
Тема Re:
Дата
Msg-id 200109071313.PAA12669@rodos
обсуждение исходный текст
Ответ на  ("postgresql" <pgsql@symcom.com>)
Список pgsql-sql
My understanding is you did it the best way. 
Alternatively, you may word your query as 
SELECT i.cname FROM fc_client_info i 
WHERE EXISTS ( SELECT * FROM fc_communication c               WHERE c.acode = i.acode        AND c.contactdate =
'09/06/2001')
 
ORDER BY lower(i.cname);
instead of 
SELECT i.cname FROM fc_client_info i, fc_communication c WHERE i.acode =
c.acode AND c.contactdate = '09/06/2001' ORDER BY lower(cname);

I suppose the correlated subquery using the EXISTS predicate, which 
results in an outer loop join, is much slower than your originally 
used sort-merge join. 
Try, but make sure both tables are well populated, otherwise the 
benchmark result is no good. 
Christoph 


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: duplicated oid
Следующее
От: Haller Christoph
Дата:
Сообщение: ERROR: DefineQueryRewrite: rule plan string too big.