|
|
|
|
Re: large data deletion [message #291754 is a reply to message #291587] |
Sun, 06 January 2008 11:05 |
|
Kevin Meade
Messages: 2103 Registered: December 1999 Location: Connecticut USA
|
Senior Member |
|
|
there is way more to this questions that meets they eye. Riddle me this:
Is 36000 rows, all the rows in the table?
What are you going to do after you delete the rows, put more back?
Is the delete part of a bigger transaction? if so, what should happen to the deleted rows if the transaction fails? (rollback I assume).
There are essentially four basic ways to get rid of rows from a table;
1) drop table x;
2) truncate table x;
3) delete from table x where (rows to delete);
4) create table x2 as select * from x where NOT (rows to delete);
CONTEMPLATE THE DIFFERENCES OF EACH APPROACH.
Only #3 runs inside the context of a transaction. All other options though potentially way faster in the right circumstances, are their own little transaction. You must account for this somehow if you try to use them.
So, vishal_srivastava, what can you tell us about the transaction this delete will live in?
Good luck, Kevin
|
|
|