Subject Re: why does restore last so long??
Author Ali Gökçen
I guess he has a lot of duplacated indexes.
FB losts itself while building that indexes (especially FKs).
He can see this state when restore in verbose to screen mode.

I have databases around 1.5 GB with 250 tables and 600 indexes
but they takes under half an hour to restore.

If your fbk and fdb files are on the same disk,
you need read from backup then write it to db.
It makes DISK arm crazy.
Reading of 2 GB file takes about 100 seconds at 20 MB/sec read speed,
writing of 1.2 GB file takes about 60 seconds at 20 MB/sec write
speed approximately in theorically.
You need minimum 3 minutes to copying the file without any
calculation and re-read. But building indexes need too much re-read
and writes.

Regards.

Ali

--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 02:56 PM 15/07/2005 +0200, you wrote:
> >Hi!
> >My database has about 1.2 GB and I made a backup with firebird
1.0 and I
> >was trying to restore it with firebird 1.5
> >Is it normal that restore can last more than 2 hours?? Usage of
> >processor during that process is between 10-20 % - so what does
engine
> >do during that time?
> >does any one know?
>
> Yes. :-=)
>
> Restore literally rebuilds your database from scratch. It
retrieves the
> metadata first and recreates all of the objects. It requests
chunks of
> disk space ("pages") as required, and builds the page inventory as
it
> goes. When all of the metadata is in place, it then reads the
data into
> the newly created structures, applying the constraints as it
> goes. Finally, it activates all of the indexes and builds them.
A
> restored database is squeaky clean.
>
> I must say I've never had a restore of a 1.2 Gb database take 2
> hours. More like 2 minutes. But I don't generally have a lot of
indexes
> and I keep very lean keys on my tables...perhaps you have a lot of
indexes
> and/or a lot of dependencies involving composite keys...
>
> Restore is very disk-intensive. Is your disk very slow, or very
> fragmented, or both? When my restores start looking a bit slow,
I'll
> schedule a disk defrag. I reserve my 7200 rpm disks for
databases, too. I
> hadn't realised what a difference disk speed made to performance
until I
> replaced some 5200 disks recently...
>
> BTW, I've found great benefit from running the Windows defrag tool
> TWICE. And defrags are much faster on a 7200 disk, as well.
>
> ./heLen