Why release index relation lock

From: DT <kurt023(at)hotmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Why release index relation lock
Date: 2013-11-02 05:33:06
Message-ID: BAY173-W528399A71D28B3547E7CCCE6F40@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

For some operations, such as INSERT/UPDATE, heap relation lock is held until
xact commit, but index relation lock is released after command end. Some other
operations also hold index relation lock until xact commit, such as VACUUM.

I have read chapter 54. Index Access Method Interface Definition in documentation,

and README in nbtree, but still can not figure out:
1. What's the rule of index relation locking?
2. Releasing lock is for higher concurrency, but for INSERT/UPDATE, i did not find
any operation that could get benefit from releasing index relation lock? Or to
say : what will happen if we treat index relation lock like heap relation lock?

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2013-11-02 11:58:25 Re: Table with Field Serial - Problem
Previous Message David Johnston 2013-11-02 00:27:15 Excellent article on SQL