Skip site navigation (1) Skip section navigation (2)

Re: locking issue on simple selects?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tobias Brox <tobixen(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: locking issue on simple selects?
Date: 2010-09-15 13:39:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Tobias Brox <tobixen(at)gmail(dot)com> writes:
> Recently we've frequently encountered issues where some simple selects
> (meaning, selects doing an index lookup and fetching one row) have
> become stuck for several minutes.  Apparently all requests on one
> exact table gets stuck, all requests not related to said table are
> going through without any problems.  According to the pg_stat_activity
> view, all queries getting stuck was read-queries (selects), no updates
> or anything like that (some of the transactions were doing updates
> and/or inserts though).

> The obvious thought seems to be that this is a locking issue ... but
> it doesn't seem so.  For one thing, AFAIK locking shouldn't affect
> selects, only updates?

An exclusive lock will block selects too.  Have you looked into pg_locks
for ungranted lock requests?

			regards, tom lane

In response to


pgsql-performance by date

Next:From: Gerhard WiesingerDate: 2010-09-15 18:39:33
Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
Previous:From: Kevin GrittnerDate: 2010-09-15 13:38:07
Subject: Re: POSTGRES error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group