Hi all,
Recently I got into a particular situation:
We have a process (process 1) which goes through all the data inserted today, from one table and do a complex calculation using multiple tables. If a particular condition is not met, I copy the data into a table (ProcessData). This process will go though > 100K of rows but will insert <1000 rows into the table.
Then I have another process (Process B), Which takes the rows from ProcessData table one by one and executes a complex processing.
Both Process A and Process B are windows services working at off peak time. They access some large and heavily used tables. (Some tables are having more than 30 million rows and get around 160, 000 kits per day)
Now what is the best way of archiving the data from ProcessData table.
Suggestion 1: When Process B completes a row delete the row and move the data into archive table
Suggestion 2: Wait until Process B completes all rows and move all rows to Archive table and truncate the table
Suggestion 3: When Process B completes a row mark the row (using a flag). Create another scheduled job to move the data using the flag periodically.
What is the best method?