Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint
Date
Msg-id 15426.1075482835@sss.pgh.pa.us
Whole thread Raw
In response to Sync vs. fsync during checkpoint  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [pgsql-hackers-win32] Sync vs. fsync during checkpoint  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> The trick is to somehow record all files modified since the last
> checkpoint, and open/fsync/close each one.   My idea is to stat() each
> file in each directory and compare the modify time to determine if the
> file has been modified since the last checkpoint.

This seems a complete non-starter, as stat() generally has at best
one-second resolution on mod times, even if you assume that the kernel
keeps mod time fully up-to-date at all times.  In any case, it's
difficult to believe that stat'ing everything in a database directory
will be faster than keeping track of it for ourselves.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Scott Lamb
Date:
Subject: Re: Mixing threaded and non-threaded
Next
From: Bruce Momjian
Date:
Subject: Re: Mixing threaded and non-threaded