Re: locking issue on simple selects? - Mailing list pgsql-performance

From Tom Lane
Subject Re: locking issue on simple selects?
Date
Msg-id 4096.1284557987@sss.pgh.pa.us
Whole thread Raw
In response to locking issue on simple selects?  (Tobias Brox <tobixen@gmail.com>)
Responses Re: locking issue on simple selects?  (Tobias Brox <tobixen@gmail.com>)
List pgsql-performance
Tobias Brox <tobixen@gmail.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

pgsql-performance by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: POSTGRES error
Next
From: Gerhard Wiesinger
Date:
Subject: Re: Major performance problem after upgrade from 8.3 to 8.4