Subject | RE: [firebird-support] Re: Fastest method of moving records between databases? |
---|---|
Author | Leyne, Sean |
Post date | 2011-05-19T17:01:07Z |
Paul,
Or better yet, only add indexes and PK/FK constraints, as many as possible, the very end. (PK/FK indexes can't be disabled)
Since you are moving from an existing database, all PK/FK are not required, since the source data already has appropriate integrity.
That should increase the speed to by a factor of 50 (if not more)!!!
Sean
> > Could you define more closely what "slow" means. How many records perDon't forget to disable all possible indexes.
> > second?
>
> Between 15 and 100 records per second depending on record size and how
> many concurrent tables are being processed. Sweep is set to 0, and all
> update/insert triggers are marked inactive.
Or better yet, only add indexes and PK/FK constraints, as many as possible, the very end. (PK/FK indexes can't be disabled)
Since you are moving from an existing database, all PK/FK are not required, since the source data already has appropriate integrity.
That should increase the speed to by a factor of 50 (if not more)!!!
> Each table is done in its own connection and the transaction is committed at the end of the processing.I would suggest that you commit after 1,000 to 10,000 rows.
> Some tables have 1,000,000+ records and 12 hours seems far too long to waitIf the database is small (1GB) then consider using a RAM disk and eliminate all disk IO. That should improve performance by at least a factor of 5!
> for a 1GB database to be processed.
> About 100 tables are insert only and do not get checked. (I can alreadyAre you using prepared statements with parameters?
> guarantee these records do not exist in the new database. About 120 tables
> check for a record to exist first. 2/3 of the records in the database are in the
> first 100 tables, so they are not being selected from the new database.
Sean