Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit34a84ad

Browse files
committed
Use page-level ExtendLock lock instead of table-level -
should be faster.
1 parent0991640 commit34a84ad

File tree

1 file changed

+10
-3
lines changed
  • src/backend/access/heap

1 file changed

+10
-3
lines changed

‎src/backend/access/heap/hio.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Id: hio.c,v 1.17 1999/02/13 23:14:24 momjian Exp $
10+
* $Id: hio.c,v 1.18 1999/05/01 15:04:46 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -110,8 +110,15 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
110110
ItemIditemId;
111111
Itemitem;
112112

113+
/*
114+
* Actually, we lock _relation_ here, not page, but I believe
115+
* that locking page is faster... Obviously, we could get rid
116+
* of ExtendLock mode at all and use ExclusiveLock mode on
117+
* page 0, as long as we use page-level locking for indices only,
118+
* but we are in 6.5-beta currently...- vadim 05/01/99
119+
*/
113120
if (!relation->rd_myxactonly)
114-
LockRelation(relation,ExtendLock);
121+
LockPage(relation,0,ExtendLock);
115122

116123
/*
117124
* XXX This does an lseek - VERY expensive - but at the moment it is
@@ -159,7 +166,7 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
159166
}
160167

161168
if (!relation->rd_myxactonly)
162-
UnlockRelation(relation,ExtendLock);
169+
UnlockPage(relation,0,ExtendLock);
163170

164171
offnum=PageAddItem((Page)pageHeader, (Item)tuple->t_data,
165172
tuple->t_len,InvalidOffsetNumber,LP_USED);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp