Subject Re: Problem with database size after the copy operation
Author Adam
--- In firebird-support@yahoogroups.com, "chsarvani"
<sarvani.cherukumilli@...> wrote:
>
> Hi,
>
> I am using fbcopy tool for copying from one FDB to another FDB.After
> copying the data from source FDB to destination FDB successfully, the
> size of both the databases should be same.

Why should both databases be the same size?

FBCopy will just be reading in the data from your source database and
issuing inserts to your destination database.

It says nothing about the free space within the source or destination
databases, nor the old record versions awaiting garbage collection in
either database.

Think of the fdb file as a container for your data and metadata. The
container must be large enough to hold all of your data, but it may be
much larger than needed too.

The internal fragmentation of a database file is almost guaranteed for
a normal database as random records are inserted, updated and deleted.
To reduce the container down to the smallest possible size, you would
need to have an internal defragmentation procedure to ensure the free
space is at the end of the container, then shrink the container.

The performance hit you get by doing this coupled with the fact you
will probably need to grow the database again makes it pretty
pointless. Firebird will reuse the free space before asking the OS to
grow the container, so don't let it worry you.

Adam