Subject Re: [firebird-support] Help With Freeing Space After Deleting
Author Alexandre Benson Smith
milizarr wrote:

>I have a table that contains BMP images that are collected
>from a Microscope for cancer screening. The recent images (those newer
>than 2 months old) are stored in the table, those that are older, are
>packed in a special format and archived. Once they are packed the
>record is deleted but looks like the table is not freeing the space, I
>have tried a sweep but the size of the FDB file does not decrease. In
>paradox I use to do a "pack" and the space was freed. Any advise is
>greatly welcome
>
>Thanks
>
>Mariano
>
>
Mariano,

I will give you a short answer, if you want a more detailed description
look in the message history, this is a vastly explained topic.

When you delete a record, FB does not give the space back to the OS.

The allocation unit of a database files is a page (de page size you
determine in the DB creation), so when you dele a record does no mean
the entire page will be unused.

and when a page are all unused it's marked as "available" to the engine,
so when you need a new page (for new insert records for example) the
engine will use first the unused pages that are on the DB file, and if
no page is unused then will ask for more space to the OS.

the only way to shrink a DB is to make a restore, but I don't think you
will need it, since the space will be used as soon as needed. If you
shrink the file, you will just make the engine asks for more space to
the OS in a short period of time.

If you delete a big number of records, and don't expect to insert new
ones in a short period of time, then the restore is the way to go.

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.1 - Release Date: 03/06/2005