Re: Slow query

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Slow query
Дата
Msg-id 1394173388580-5795079.post@n5.nabble.com
обсуждение исходный текст
Ответ на Slow query  (Bikram Kesari Naik <bikram.naik@onmobile.com>)
Ответы Re: Slow query
Список pgsql-performance
Bikram Kesari Naik wrote
> Hi,
>
> I have a view which joins  multiple tables to give me a result. It takes
> more than a  minute to give me the result on psql prompt when I select all
> the data from that view.
> The single CPU which is used to run this query is utilized 100%.Even if I
> fire a count(*) it takes 10 Sec. I wanted to know if there is anything we
> can do to speedup this query below 1 sec.

In all likelihood you need to index your foreign keys, and possibly other
fields, but as you haven't provided table and index definitions it is hard
to say for sure.

Idepeing on how many rows are hidden I'm not sure an unqualified query on
this view can run in 1/60th the time even with indexes present - the
sequential scans are efficient if the proportion of the tables being
returned is high.

David J.





--
View this message in context: http://postgresql.1045698.n5.nabble.com/Slow-query-tp5795077p5795079.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


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

Предыдущее
От: Bikram Kesari Naik
Дата:
Сообщение: Slow query
Следующее
От: Bikram Kesari Naik
Дата:
Сообщение: Re: Slow query