Search Postgresql Archives

Re: Query sometimes takes down server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux