mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Tune BufferGetLSNAtomic() when checksums !enabled
From performance analysis by Heikki Linnakangas
This commit is contained in:
parent
cf8dc9e10c
commit
1be203519a
@ -2079,8 +2079,10 @@ BufferGetLSNAtomic(Buffer buffer)
|
||||
char *page = BufferGetPage(buffer);
|
||||
XLogRecPtr lsn;
|
||||
|
||||
/* Local buffers don't need a lock. */
|
||||
if (BufferIsLocal(buffer))
|
||||
/*
|
||||
* If we don't need locking for correctness, fastpath out.
|
||||
*/
|
||||
if (!DataChecksumsEnabled() || BufferIsLocal(buffer))
|
||||
return PageGetLSN(page);
|
||||
|
||||
/* Make sure we've got a real buffer, and that we hold a pin on it. */
|
||||
|
Loading…
Reference in New Issue
Block a user