Subject | Re: [firebird-support] can you "compact" a database ? |
---|---|
Author | Lester Caine |
Post date | 2007-12-31T13:44:48Z |
Helen Borrie wrote:
problems with the growing data on sites which a 'defragment' seems to clear
up, so preventing the fragmentation in the first place seems like a good move.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird - http://www.firebirdsql.org/index.php
>>> Silly thought basically since my databases are now moving from sub 100Mb toThat sounds like a move in the right direction. I'm starting to see speed
>>> the 100 to 500Mb range.
>>> Is there a means of asking for a single 500Mb of space when restoring a
>>> database? So that we have expansion space already allocated.
>
> At 09:47 PM 31/12/2007, Ivan Prenosil wrote:
>
>> FB database file does not hold information about number of pages allocated,
>> it is simply derived from the size of file itself.
>> So, you can easily expand file size using simple OS API calls.
>> On Windows you just need SetFilePointer() and SetEndOfFile().
>> (But of course you are doing it on your own risk.)
>
> Indeed. The page inventory won't know about all that "spare" space because it's unallocated. If it thinks it wants more space than its inventory says it has, it requests more. So, instead of having a database file rebuild itself and grow compactly, it will be a big empty balloon accreting a zillion fragments off its perimeter.
>
> Did you know that Fb 2.1 is allocates new pages in batches of a configurable size? As well as giving some "headspace" when approaching a disk full condition, it reduces the amount of disk fragmentation also.
problems with the growing data on sites which a 'defragment' seems to clear
up, so preventing the fragmentation in the first place seems like a good move.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird - http://www.firebirdsql.org/index.php