Re: Join query on 1M row table slow

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Join query on 1M row table slow
Дата
Msg-id 14832.1076473914@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Join query on 1M row table slow  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
"scott.marlowe" <scott.marlowe@ihs.com> writes:
> Oh, another thing is to make your select in the in() clause a select
> distinct and see if that helps.  If you've got a whole bunch of duplicates
> running around in it it's sometimes faster to distinct it.  Then again,
> given all the work Tom's been putting in the query planner / optimization,
> he may have already done something like that.

As of CVS tip I would not recommend inserting DISTINCT in an "IN
(subselect)" construct --- the planner will do the equivalent for itself
if it figures that's the best way.  I do not recall this late at night
whether all the relevant changes were in 7.4 or not ...

            regards, tom lane

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

Предыдущее
От: "muteki muteki"
Дата:
Сообщение: pg_class and relfilenode
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Temporary views