Subject | Gbak restore vs. recreating the database |
---|---|
Author | Ann W. Harrison |
Post date | 2006-12-01T18:01:32Z |
Often when someone asks how to move a database between
two similar but not identical engines (e.g. InterBase x
and Firebird) the recommendation is to extract the
metadata, create a new database, and use one of the
dump/load utilities to move the data.
That fine, but after you load the data, you should
set the statistics on all indexes. Or, better yet,
edit the definitions so indexes are created after the
data is loaded. That means not defining primary key,
foreign key, or unique constraints until the data is
loaded.
First, the load will be faster because it doesn't have to
build indexes on the fly. Building indexes on existing
data is done by sorting the data and building the index
bottom up - faster than record by record.
But more important, you'll get lousy statistics if you
load a database after the indexes have been created.
Index statistics are set when the index is created or
reactivated. Indexes are created when their definition
is committed. Gbak doesn't commit index definitions
until the data is in place.
Regards
Ann
two similar but not identical engines (e.g. InterBase x
and Firebird) the recommendation is to extract the
metadata, create a new database, and use one of the
dump/load utilities to move the data.
That fine, but after you load the data, you should
set the statistics on all indexes. Or, better yet,
edit the definitions so indexes are created after the
data is loaded. That means not defining primary key,
foreign key, or unique constraints until the data is
loaded.
First, the load will be faster because it doesn't have to
build indexes on the fly. Building indexes on existing
data is done by sorting the data and building the index
bottom up - faster than record by record.
But more important, you'll get lousy statistics if you
load a database after the indexes have been created.
Index statistics are set when the index is created or
reactivated. Indexes are created when their definition
is committed. Gbak doesn't commit index definitions
until the data is in place.
Regards
Ann