Commit 1be20351 authored by Simon Riggs's avatar Simon Riggs

Tune BufferGetLSNAtomic() when checksums !enabled

From performance analysis by Heikki Linnakangas
parent cf8dc9e1
...@@ -2079,8 +2079,10 @@ BufferGetLSNAtomic(Buffer buffer) ...@@ -2079,8 +2079,10 @@ BufferGetLSNAtomic(Buffer buffer)
char *page = BufferGetPage(buffer); char *page = BufferGetPage(buffer);
XLogRecPtr lsn; 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); return PageGetLSN(page);
/* Make sure we've got a real buffer, and that we hold a pin on it. */ /* Make sure we've got a real buffer, and that we hold a pin on it. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment