Re: Very slow queries - please help.

Поиск
Список
Период
Сортировка
От Guillaume Smet
Тема Re: Very slow queries - please help.
Дата
Msg-id 4385D653.7020804@openwide.fr
обсуждение исходный текст
Ответ на Re: Very slow queries - please help.  ("Bealach-na Bo" <bealach_na_bo@hotmail.com>)
Список pgsql-performance
Hi,

> I'm also sending the EXPLAIN outputs.

Please provide EXPLAIN ANALYZE outputs instead of EXPLAIN. You will have
more information.

Indexes on your tables are obviously missing. You should try to add:

CREATE INDEX idx_node_filter ON node(name, type, usage);
CREATE INDEX idx_job_log_filter ON job_log(job_name, job_start, job_stop);

I'm not so sure it's a good idea to add job_stop in this index as you
have an IS NULL in your query so I'm not sure it can be used. You should
try it anyway and remove it if not needed.

I added all your search fields in the indexes but it depends a lot on
the selectivity of your conditions. I don't know your data but I think
you understand the idea.

HTH

--
Guillaume

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

Предыдущее
От: "Bealach-na Bo"
Дата:
Сообщение: Re: Very slow queries - please help.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Very slow queries - please help.