Subject | Performance when deleting a lot of records, again |
---|---|
Author | Christian Kaufmann |
Post date | 2005-04-04T11:45:22Z |
Hi,
I still have some questions about how I should proceed.
A table has 2-3 million records, will grow and about 6 indexes on it.
In a task, I rebuild about 100 blocks of 5000-20000 records in this
table, by delete them first and then reinsert the new records.
During this task, I deactivate all except one of my indexes run it and
at the end activate all indexes again. It runs reasonable fast now.
But when I do a backup to trigger a sweep, the backup of this table
takes so long, probably because of the sweep that is done during the
backup. What I found is, that a backup with deactivated indexes is
much faster, probably because there is no update done in the indexes
during the sweep.
So I think the correct process is:
- deactivate indexes
- run task to rebuild tables
- backup database to perform a sweep
- activate indexes again
Did I miss something? And is there a way to perform a sweep from a
Delphi application?
cu Christian
I still have some questions about how I should proceed.
A table has 2-3 million records, will grow and about 6 indexes on it.
In a task, I rebuild about 100 blocks of 5000-20000 records in this
table, by delete them first and then reinsert the new records.
During this task, I deactivate all except one of my indexes run it and
at the end activate all indexes again. It runs reasonable fast now.
But when I do a backup to trigger a sweep, the backup of this table
takes so long, probably because of the sweep that is done during the
backup. What I found is, that a backup with deactivated indexes is
much faster, probably because there is no update done in the indexes
during the sweep.
So I think the correct process is:
- deactivate indexes
- run task to rebuild tables
- backup database to perform a sweep
- activate indexes again
Did I miss something? And is there a way to perform a sweep from a
Delphi application?
cu Christian