Re: determining which operation is blocking another query

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: determining which operation is blocking another query
Дата
Msg-id 20060525072707.GA31892@winnie.fuhr.org
обсуждение исходный текст
Ответ на determining which operation is blocking another query  ("Sriram Dandapani" <sdandapani@counterpane.com>)
Список pgsql-admin
On Wed, May 24, 2006 at 11:49:37PM -0700, Sriram Dandapani wrote:
> Is there a system view that can be used to determine which
> INSERT/UPDATE/DELETE/Other Operation is blocking a SELECT statement.

Query pg_locks to see what locks transactions have acquired or are
waiting to acquire.  If you have stats_command_string enabled then
querying pg_stat_activity should show sessions' current queries.

Are you sure SELECT is blocked, or could it just be taking a long
time?  MVCC allows SELECT to run concurrently with INSERT, UPDATE,
and DELETE without blocking; only a few operations like VACUUM FULL
block an ordinary SELECT (without FOR SHARE or FOR UPDATE).

--
Michael Fuhr

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

Предыдущее
От: "Sriram Dandapani"
Дата:
Сообщение: determining which operation is blocking another query
Следующее
От: Adam Radlowski
Дата:
Сообщение: Re: defining Your own sort order for already compiled PostgreSQL