mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
Arrange for read-only accesses to SLRU page buffers to take only a shared
lock, not exclusive, if the desired page is already in memory. This can be demonstrated to be a significant win on the pg_subtrans cache when there is a large window of open transactions. It should be useful for pg_clog as well. I didn't try to make GetMultiXactIdMembers() use the code, as that would have taken some restructuring, and what with the local cache for multixact contents it probably wouldn't really make a difference. Per my recent proposal.
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/subtrans.c,v 1.13 2005/11/22 18:17:07 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/subtrans.c,v 1.14 2005/12/06 18:10:06 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -110,9 +110,9 @@ SubTransGetParent(TransactionId xid)
|
||||
if (!TransactionIdIsNormal(xid))
|
||||
return InvalidTransactionId;
|
||||
|
||||
LWLockAcquire(SubtransControlLock, LW_EXCLUSIVE);
|
||||
/* lock is acquired by SimpleLruReadPage_ReadOnly */
|
||||
|
||||
slotno = SimpleLruReadPage(SubTransCtl, pageno, xid);
|
||||
slotno = SimpleLruReadPage_ReadOnly(SubTransCtl, pageno, xid);
|
||||
ptr = (TransactionId *) SubTransCtl->shared->page_buffer[slotno];
|
||||
ptr += entryno;
|
||||
|
||||
|
Reference in New Issue
Block a user