Avoid unnecessary page-level SSI lock check in heap_insert().
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Sep 2011 18:47:27 +0000 (14:47 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Sep 2011 18:47:27 +0000 (14:47 -0400)
commite5b86c93b66b5caeb25a65bae26b04fc7a068957
tree4b5e7b8f78b609785ae4be2f3c463f8303649e49
parent57d3dc2035fe8267e877620eddc3823360c7878f
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.
src/backend/access/heap/heapam.c