Subject Re: [firebird-support] Fastest method of moving records between databases?
Author Milan Babuskov
cantak3 wrote:
> The application:
> - Builds a list of tables/PKs in a source and destination database
> - Disables sweep and all insert/update triggers in the destination
> - Processes each record in each table in the source
> - Checks if the record exists in the destination using the primary keys and selected values
> - If the record exists, it updates it. If not, it inserts it.
> - Reenables sweep and triggers once done, then updates generator values
>
> There are other criteria for this select which I need not specify here. But this is the basic steps to copying records from one database to another for me. I cannot use FB 2.5's ability to connect to multiples. I cannot use the MERGE or the UPDATE OR INSERT methodology introduced in 2.1.
>
> This is unbearably slow.

Could you define more closely what "slow" means. How many records per
second?

Did you consider disabling forced writes?

Also, take a look at statistics, do you do more inserts or updates. If
you have more inserts maybe it would be a better idea to insert and then
update if it fails because of PK or Unique constraint.

--
Milan Babuskov

==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================