Tuning for PostGreSQL Database

Alexander Leidinger Alexander at Leidinger.net
Tue Jul 22 03:29:47 PDT 2003

On Mon, 21 Jul 2003 15:24:00 -0500
"Jim C. Nasby" <jim at nasby.net> wrote:

> Of course the *real* issue is ensuring that no matter what, the WAL hits
> the disk before the main table data does, so that you can do proper
> recovery (though I'm not as clear on how this works with MVCC). If the
> issue is only a matter of delayed writes across the board, I don't see
> that it should really matter... it's just as if the plug got pulled a
> little earlier.

SoftUpdates affects metadata updates. Simplified explanation: if you
don't use SU and delete more than one file in a directory, the changed
directory information gets written to disk after every deleted file,
with SU enabled it just writes the directory information after the last
deleted file (actually SU doesn't know what the last file is, so it uses
some heuristics, but for this example you can ignore this fact) to disk,
every change in between will happen in memory only. The same applies to
the metadata of files (access time, modification time, ...).

So if you replace a file with SU enabled you may get either the old one
or the new one, but no inconsistent state in between (this is possible
without SU).

Without SU the window of the race condition is smaller, but it's still
there. I'm not aware of a statistical measurement of the difference, but
I think the probability of "the plug gets pulled in the wrong moment" is
the same (Murphy's law applied to this: the probability is "1" ;-) ).


              The best things in life are free, but the
                expensive ones are still worth a look.

http://www.Leidinger.net                       Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7

More information about the freebsd-performance mailing list