From: Michael Fuhr <mike@fuhr.org>
To: Sriram Dandapani <sdandapani@counterpane.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: determining which operation is blocking another query
Date: Thu, 25 May 2006 01:27:07 -0600
Message-ID: <20060525072707.GA31892@winnie.fuhr.org> (raw)
In-Reply-To: <6992E470F12A444BB787B5C937B9D4DF04997303@ca-mail1.cis.local>
References: <6992E470F12A444BB787B5C937B9D4DF04997303@ca-mail1.cis.local>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, sdandapani@counterpane.com
Subject: Re: determining which operation is blocking another query
In-Reply-To: <20060525072707.GA31892@winnie.fuhr.org>
References: <6992E470F12A444BB787B5C937B9D4DF04997303@ca-mail1.cis.local> <20060525072707.GA31892@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox