Re: Query sometimes takes down server

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Query sometimes takes down server
Дата
Msg-id 1232068337.32625.164.camel@dell.linuxdev.us.dell.com
обсуждение исходный текст
Ответ на Query sometimes takes down server  (Jason Long <mailing.list@supernovasoftware.com>)
Список pgsql-general
On Thu, 2009-01-15 at 18:44 -0600, Jason Long wrote:
> The query that hangs the system is requesting a count(*)
> based on some parameters the users selects.

Can you show an example of the full offending query? How big is the
table?

> And maybe 1 in 20 will not complete.

If you really have nothing else running on the server, the queries
should complete.

> I have not looked into the detail of the explain, and I do see visually
> that very different plans are being chosen.

It would help to share these plans with us...

Run it several times using EXPLAIN ANALYZE, and send the output of one
that completes quickly, one that takes a while, and preferably wait for
a long-running one to finish. For those that you can't wait for, show
plain EXPLAIN output.

> How can I see the plan that was chosen when the time it very high?
> Is there a way to print the query plan chosen when the query times out
> as well?
>

There's a new module coming in 8.4 that makes this much easier. Right
now, you have to run it yourself with EXPLAIN ANALYZE as above.

Regards,
    Jeff Davis


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

Предыдущее
От: Jason Long
Дата:
Сообщение: Query sometimes takes down server
Следующее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: HTML email (was: Re: Vacuum and Reindex hangs)