> * Bruce Momjian <pgman@candle.pha.pa.us> wrote:
>
> | Most Unix filesystems will not allocate disk blocks until you write in
> | them. If you just seek out past end-of-file, the file pointer is moved
> | but the blocks are unallocated. This is how 'ls' can show a 1gb file
> | that only uses 4k of disk space.
>
> Does this imply that we could get a performance gain by preallocating space
> for indexes and data itself as well ? I've seen that other database products
> have a setup step where you have to specify the size of the database.
>
> Or does PostgreSQL do any other tricks to prevent fragmentation of data ?
If we stored all our tables in one file that would be needed. Since we
use the OS to do the defragmenting, I don't think it is an issue. We do
allocate in 8k chunks to allow the OS to allocate full filesystem blocks
already. Not sure if preallocating even more would help.
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026