"full_page_writes" makes no difference? - Mailing list pgsql-hackers

From Tian Luo
Subject "full_page_writes" makes no difference?
Date
Msg-id BANLkTimxQg89qKAOn6obuY_9n3U2E=fHiw@mail.gmail.com
Whole thread Raw
Responses Re: "full_page_writes" makes no difference?  (Markus Wanner <markus@bluegap.ch>)
Re: "full_page_writes" makes no difference?  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Re: "full_page_writes" makes no difference?  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
Hi guys,

No matter I turn on or turn off the "full_page_writes", I always
observe 8192-byte writes of log data for simple write operations
(write/update).

But according to the document, when this is off, it could speed up
operations but may cause problems during recovery. So, I guess this is
because it writes less when the option is turned off. However, this
contradicts my observations ....

If I am not missing anything, I find that the writes of log data go
through function "XLogWrite" in source file
"backend/access/transam/xlog.c".

In this file, log data are written with the following code:

from = XLogCtl->pages + startidx * (Size) XLOG_BLCKSZ;
nbytes = npages * (Size) XLOG_BLCKSZ;
if (write(openLogFile, from, nbytes) != nbytes)
{...
}

So, "nbytes" should always be multiples of XLOG_BLCKSZ, which in the
default case, is 8192.

My question is, if it always writes full pages no matter
"full_page_writes" is on or off, what is the difference?

Thanks!

Regards,
- Tian


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Predicate locking
Next
From: David Blewett
Date:
Subject: Re: branching for 9.2devel