Tony Day <tonyd(at)panztel(dot)com> writes:
> We are running PostgreSQL 8.3.9 on Ubuntu 9.04 and yesterday the Postgresql
> log reported about 15 SQL queries that had taken between 30,000 and 50,000
> seconds (not ms) to execute.
> All (except one) of the queries are single Inserts to the same relatively
> simple table (no triggers or the like).
> A colleague has suggested that it might be a deadlock but my understanding
> is that Postgresql identifies deadlocks and terminates one of the queries.
> I would appreciate any suggestions of where to look and (more importantly)
> what to look for to figure this out.
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.
regards, tom lane
In response to
pgsql-novice by date
|Next:||From: Tony Day||Date: 2010-04-30 05:24:38|
|Subject: Re: Long (really long) queries and not sure how to diagnose|
|Previous:||From: Tony Day||Date: 2010-04-30 01:59:55|
|Subject: Long (really long) queries and not sure how to diagnose|