Subject Re: Database file disk fragmentation
Author Adam
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@...> wrote:
>
> > > I don't want to argue whether fragmentation will cause or not
> > performance
> > > issues because it definitely will and the larger the database the
> > > bigger the penalty.
> >
> > Alex,
> >
> > I think you are wasting your time. Firebird works with pages and could
> > not care less as to how fragmented the database file is. It doesn't
> > even care if it is in 1 file or 10. If you observed any benefit, it
> > would have been due to the removal of garbage and rebuilding of
the index.
>
> but Adam, imagine the DB page size equals the HD cluster size.
> It's not hard to imagine that after many database operations, the
clusters
> (i.e. pages) are scattered over a HD, and defragmenation would tend
to put
> this clusters back in a contiguous block on the HD.

It could result in this, but to get any advantage out of it, you would
have to be reading large chunks of a large table in sequential order.
The moment an index becomes involved, it is irrelevant.

Firebird tends to prefer in memory sorts to indexed walks of a table,
because indexed walks generally cause thrashing after the database
starts inserting, updating and deleting records.

Adam