Re: [HACKERS] Changing the default wal_sync_method to open_sync for
- From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
- To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
- Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org, pgsql-hackers-win32(at)postgresql(dot)org, Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>
- Subject: Re: [HACKERS] Changing the default wal_sync_method to open_sync for
- Date: Wed, 16 Mar 2005 23:31:59 -0500 (EST)
- Message-id: <200503170431(dot)j2H4VxZ22924(at)candle(dot)pha(dot)pa(dot)us>
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> 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
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
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 */
Home |
Main Index |
Thread Index