Re: [HACKERS] Changing the default wal_sync_method to open_sync for

Bruce Momjian <[email protected]> Wed, 16 Mar 2005 23:31:59 -0500 (EST)
Newsgroups gmane.comp.db.postgresql.devel.win32,gmane.comp.db.postgresql.devel.general
Message-ID <[email protected]>
Tom Lane wrote:
> Bruce Momjian <[email protected]> writes:
> > Notice we never default to open_sync.  However, on Win32, Magnus got a
> > 60% speedup by using open_sync, implemented using
> > FILE_FLAG_WRITE_THROUGH.  Now, because this the fastest on Win32, I
> > think we should default to open_sync on Win32.  The attached patch
> > implements this.
> 
> ... and breaks open_datasync for all other platforms ...

Oh, fixed.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [email protected]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
/pgpatches/osync (text/plain, 941 B)
Index: src/backend/access/transam/xlog.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.181
diff -c -c -r1.181 xlog.c
*** src/backend/access/transam/xlog.c	12 Feb 2005 23:53:37 -0000	1.181
--- src/backend/access/transam/xlog.c	17 Mar 2005 04:31:32 -0000
***************
*** 69,74 ****
--- 69,79 ----
  #endif
  #endif
  
+ #if defined(WIN32)	/* Fastest on Win32 using FILE_FLAG_WRITE_THROUGH */
+ #define DEFAULT_SYNC_METHOD_STR    "open_sync"
+ #define DEFAULT_SYNC_METHOD		   SYNC_METHOD_OPEN
+ #define DEFAULT_SYNC_FLAGBIT	   OPEN_SYNC_FLAG
+ #else
  #if defined(OPEN_DATASYNC_FLAG)
  #define DEFAULT_SYNC_METHOD_STR    "open_datasync"
  #define DEFAULT_SYNC_METHOD		   SYNC_METHOD_OPEN
***************
*** 84,89 ****
--- 89,95 ----
  #define DEFAULT_SYNC_FLAGBIT	  0
  #endif
  #endif
+ #endif
  
  
  /* User-settable parameters */