Subject RE: [firebird-support] can you "compact" a database ?
Author Peter Turner
I guess a good follow on question to the compaction/deletion question would be...

Does the space from the deleted records that is now "available" for future database transactions contain the data from the previous data set? Or is it cleared (filled with 0's). (eg. the ability to securely delete data records).

Pete.

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of Lester Caine
Sent: Monday, December 31, 2007 8:45 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] can you "compact" a database ?


Helen Borrie wrote:
>>> Silly thought basically since my databases are now moving from sub 100Mb to
>>> 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.

That sounds like a move in the right direction. I'm starting to see speed
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



[Non-text portions of this message have been removed]