pgsql: Avoid unnecessary page-level SSI lock check in heap_insert().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid unnecessary page-level SSI lock check in heap_insert().
Date: 2011-09-16 18:47:44
Message-ID: E1R4dRw-00041N-3f@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid unnecessary page-level SSI lock check in heap_insert().

As observed by Heikki, we need not conflict on heap page locks during an
insert; heap page locks are only aggregated tuple locks, they don't imply
locking "gaps" as index page locks do. So we can avoid some unnecessary
conflicts, and also do the SSI check while not holding exclusive lock on
the target buffer.

Kevin Grittner, reviewed by Jeff Davis. Back-patch to 9.1.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9d306c66e63eb7f45eab9475b3f96c3134bacac6

Modified Files
--------------
src/backend/access/heap/heapam.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-09-16 20:36:10 pgsql: Add FORCE_NOT_NULL support to the file_fdw foreign data wrapper.
Previous Message Tom Lane 2011-09-16 16:31:50 pgsql: Ensure generic plan gets used for a plpgsql expression with no p