Re: Long (really long) queries and not sure how to diagnose

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Long (really long) queries and not sure how to diagnose
Дата
Msg-id 13706.1272603707@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Long (really long) queries and not sure how to diagnose  (Tony Day <tonyd@panztel.com>)
Список pgsql-novice
Tony Day <tonyd@panztel.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

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

Предыдущее
От: Tony Day
Дата:
Сообщение: Long (really long) queries and not sure how to diagnose
Следующее
От: Tony Day
Дата:
Сообщение: Re: Long (really long) queries and not sure how to diagnose