![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hi I wish to delete/import a lot of data into a database and want it to run as quickly as possible (using DTS here). The triggers don't need to run, so to improve performance I should obviously disable the triggers. Is there anything else that I should be considering here in terms of the database schema? What about indexes - I would have thought that it would be more efficient to disable the indexes, import the data and then rebuild the index rather than keeping the index on all thie time. Is this assumption correct? If so, is there a way to disable all indexes and re-enable them as one can with triggers rather than dropping them and rebuilding them (I ask because I don't really want to hard-code the index definitions into the DTS package - the database schema might change from time to time and I don't want to have to keep updating the package...). Thanks in advance Griff |
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi SriSamp Thanks for that. However, is there a way of simply disabling the currently existing indexes and re-enabling them afterwards? I ask this because the indexes that may be there when I design the DTS package may not be the same ones that exist when the DTS package is run (the database schema may change). Alternatively, is there a way to identify at run time the indexes that exist, store all the information necessary to re-create these indexes, drop these indexes, import the data and them rebuild the indexes from the stored information? Any code examples would be much appreciated. Thanks Griff |
#4
| |||
| |||
|
|
Hi SriSamp Thanks for that. However, is there a way of simply disabling the currently existing indexes and re-enabling them afterwards? I ask this because the indexes that may be there when I design the DTS package may not be the same ones that exist when the DTS package is run (the database schema may change). Alternatively, is there a way to identify at run time the indexes that exist, store all the information necessary to re-create these indexes, drop these indexes, import the data and them rebuild the indexes from the stored information? Any code examples would be much appreciated. Thanks Griff |
#5
| |||
| |||
|
|
Interestingly, I ran the code and found a "hypothetical" index that doesn't exist on the schema... hind_264648286_2A_7A_10A nonclustered, hypothetical, auto create located on PRIMARY fieldA, field B, fieldC So what's this when it's at home? |
![]() |
| Thread Tools | |
| Display Modes | |
| |