On Sat, Feb 17, 2001 at 03:45:30PM -0500, Bruce Momjian wrote:
> > Right now the WAL preallocation code (XLogFileInit) is not good enough
> > because it does lseek to the 16MB position and then writes 1 byte there.
> > On an implementation that supports holes in files (which is most Unixen)
> > that doesn't cause physical allocation of the intervening space. We'd
> > have to actually write zeroes into all 16MB to ensure the space is
> > allocated ... but that's just a couple more lines of code.
>
> Are OS's smart enough to not allocate zero-written blocks?
No, but some disks are. Writing zeroes is a bit faster on smart disks.
This has no real implications for PG, but it is one of the reasons that
writing zeroes doesn't really wipe a disk, for forensic purposes.
Nathan Myers
ncm@zembu.com