Search Postgresql Archives

Re: odd intermittent query hanging issue

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

 



On 05/18/2012 11:01 AM, Aaron Burnett wrote:
... One particular query will run perfectly fine (around 5 seconds)
for several weeks, then suddenly decide to hang indefinitely and never
finish....
Is the machine busy processing the query or is it idle?

It is processing and in fact drives the load up a bit.
What CPU, disk and memory is it using? It would be very interesting to see the query plan when things go South.

Yeah, the query is poo... autogenerated... the LEFT JOIN is not needed as I have pointed out to the person responsible for the code many times, and
the 'in(1)' may indeed have many categories in there. But the OLY one that
hangs is the 'in(1)'

Is "1" the largest category? Also, how have you tuned work_mem (show work_mem;)?

When the query gets bad do you see PostgreSQL swapping to temp files (watch files in PGDATA/base/DB_OID/pgsql_tmp). Note that work_mem can be set per-connection so you if it is too small for your nighttime maintenance you can adjust it for those operations only.

Cheers,
Steve

--
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