"Magnus Hagander" <[EMAIL PROTECTED]> writes:
> Oh, and finally. The win32 commands have the following options:
> FILE_FLAG_NO_BUFFERING. This disables the cache completely. It also has
> lots of limits, like every read and write has to be on a sector boundary
> etc. It gives great performance with async I/O, because it bypasses the
> memory manager. It appears to be like O_DIRECT on linux?

> FILE_FLAG_WRITE_THROUGH:
> "
> Instructs the system to write through any intermediate cache and go
> directly to disk. 

> If FILE_FLAG_NO_BUFFERING is not also specified, so that system caching
> is in effect, then the data is written to the system cache, but is
> flushed to disk without delay.

> If FILE_FLAG_NO_BUFFERING is also specified, so that system caching is
> not in effect, then the data is immediately flushed to disk without
> going through the system cache. The operating system also requests a
> write-through the hard disk cache to persistent media. However, not all
> hardware supports this write-through capability.
> "

AFAICS it would make sense for us to specify both of those flags for WAL
writes.

We could either hack win32_open() to translate O_SYNC to those flags,
or make xlog.c aware of the Windows spellings of the flags.  Probably
the former is less painful given that open.c already does wholesale
translations of open() flags.

One point that I no longer recall the reasoning behind is that xlog.c
doesn't think O_SYNC is a preferable default over fsync.  We'd certainly
want to hack xlog.c to change its mind about that, at least on Windows;
assuming that the FILE_FLAG way is indeed faster.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to