Re: Indices arent being used

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Indices arent being used
Дата
Msg-id 6354.1064682842@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Indices arent being used  (rantunes@student.dei.uc.pt)
Список pgsql-performance
rantunes@student.dei.uc.pt writes:
> Here is the explain analyze of the query:
> explain analyze select count(*) from actvars, prodlevel where
> actvars.product_level=prodlevel.code_level and
> prodlevel.division_level='OY3S5LAPALL6';

> [ slow merge join ]

I wonder whether a hash join wouldn't work better.  Can you force a hash
join?  (Try "enable_mergejoin = 0" and if needed "enable_nestloop = 0";
don't disable seqscans though.)  If you can get such a plan, please post
the explain analyze results for it.

> This method forces the indices to work but it looks like it takes a long to
> finish executing, I had to cancel the query after 10 min.

"Force use of the indexes" is not always an answer to performance issues.

            regards, tom lane

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

Предыдущее
От: rantunes@student.dei.uc.pt
Дата:
Сообщение: Re: Indices arent being used
Следующее
От: Richard Jones
Дата:
Сообщение: advice on raid controller