Re: Can postgres create a file with physically continuous blocks.

From: Rob Wultsch <wultsch(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jim Nasby <jim(at)nasby(dot)net>, flyusa2010 fly <flyusa2010(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Can postgres create a file with physically continuous blocks.
Date: 2010-12-22 01:45:55
Message-ID: AANLkTim=-GLts=oAMD+paZJ_FW0wCQgs_HHFTSv1zggX@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 21, 2010 at 4:49 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Sun, Dec 19, 2010 at 1:10 PM, Jim Nasby <jim(at)nasby(dot)net> wrote:
>> On Dec 19, 2010, at 1:10 AM, flyusa2010 fly wrote:
>>> Does postgres make an effort to create a file with physically continuous blocks?
>>
>> AFAIK all files are expanded as needed. I don't think there's any flags you can pass to the filesystem to tell it "this file will eventually be 1GB in size". So, we're basically at the mercy of the FS to try and keep things contiguous.
>
> There have been some reports that we would do better on some
> filesystems if we extended the file more than a block at a time, as we
> do today.  However, AFAIK, no one is pursuing this ATM.
>

The has been found to be the case in the MySQL world, particularly
when ext3 is in use:
http://forge.mysql.com/worklog/task.php?id=4925
http://www.facebook.com/note.php?note_id=194501560932

Also, InnoDB has an option for how much data should be allocated at
the end of a tablespace when it needs to grow:
http://dev.mysql.com/doc/refman/5.0/en/innodb-parameters.html#sysvar_innodb_data_file_path

--
Rob Wultsch
wultsch(at)gmail(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-12-22 02:01:23 Re: strncmp->memcmp when we know the shorter length
Previous Message Gurjeet Singh 2010-12-22 01:29:46 Re: strncmp->memcmp when we know the shorter length