Subject Re: [firebird-support] can you "compact" a database ?
Author Ann W. Harrison
peter_nn0 wrote:
>
> I wonder if it's possible to "compact" a database, in other words to
> delete permanently the deleted data.

Deleted data is deleted, permanently. The space it took will be
reclaimed and reused. Reusing space has several benefits. In
general, it is faster to write over part of a file than to extend
the file. In specific, reusing space reduces file and disk fragmentation.

> I have a database ~50MB. After deleting all the entries in most tables,
> the database file size is practically the same, while it should be 2MB
> at most. This means data is just marked as deleted, but in fact
> remains - I'm looking for a way to remove it really.
>

Why do you want to release the space back to the operating system?
50MB of disk costs about nothing... and, in all likelihood, you'll
be storing new data. Storing it in existing free space is quicker
than reallocating space. Retrieving data from a less fragmented
file is quicker than using a more fragmented file.

So what are you trying to do?


Regards,


Ann