We have table A which contains a great deal of information about our "entities" (id, name, address, etc.) in a specific format for the other system we send the information to and various reports, procedures etc. We can't change how this table is/the overall procedure is done because of the dependencies.
Currently the script create a temp table of the IDs (the ones who have changes in the system, determined in the overall script) and then what we do is delete the rows in table A where the id is in the temp table. We then repopulate the data in table A (using an insert) for those IDs in the temp table.
I am finding the delete takes a long time. All other parts of the procedure run fairly quick, or as expected. Is there a good way I could optimize this delete? I realize the delete effects the table as well as the indexes, but I wish there were a better way. I've looked up information about a direct-path insert but I do not totally understand what this does, and if this could even be applied in my case.
Thanks for the help.
Currently the script create a temp table of the IDs (the ones who have changes in the system, determined in the overall script) and then what we do is delete the rows in table A where the id is in the temp table. We then repopulate the data in table A (using an insert) for those IDs in the temp table.
I am finding the delete takes a long time. All other parts of the procedure run fairly quick, or as expected. Is there a good way I could optimize this delete? I realize the delete effects the table as well as the indexes, but I wish there were a better way. I've looked up information about a direct-path insert but I do not totally understand what this does, and if this could even be applied in my case.
Thanks for the help.