Re: Long (really long) queries and not sure how to diagnose - Mailing list pgsql-novice

From Tony Day
Subject Re: Long (really long) queries and not sure how to diagnose
Date
Msg-id l2t22eb2d871004292224hef0a1dfas6068c40c57284d6a@mail.gmail.com
Whole thread Raw
In response to Long (really long) queries and not sure how to diagnose  (Tony Day <tonyd@panztel.com>)
Responses Re: Long (really long) queries and not sure how to diagnose  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Hi Tom


Best guess from here is that some transaction took a write-preventing
lock on that table, and then sat on it for a really long time.  If this
were still going on, a look into pg_stat_activity and/or pg_locks would
quickly prove or refute that theory.  Since it's not, there's probably
not much you can do right now unless you have complete query logs to
study.  What I'd suggest is familiarizing yourself with those views
so you'll be better prepared to investigate next time.


Thanks for the response.

I have looked at pg_stat_activity previously but I had never heard of pg_locks before.
Having said that, looking and knowing what to look for are quite different :-)
I will spend some time trying to get to know both.

I am not sure what you mean by "complete query logs" but I do have a 1.3G Postgresql log file from the day in question.
Is there a particular way that a "write-preventing lock" will be logged that I can search for in that file?

Regards, Tony

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Long (really long) queries and not sure how to diagnose
Next
From: Tom Lane
Date:
Subject: Re: Long (really long) queries and not sure how to diagnose