MySQL Forums
Forum List  »  Newbie

Delete taking a long time to complete
Posted by: Greg Hines
Date: April 29, 2010 12:23AM

Hi All,

I have a simple SP that deletes from several InnoDB tables. eg:

BEGIN
   DELETE FROM Table1 WHERE StrID=iSid AND DOB >= StartDate;
   DELETE FROM Table2 WHERE StrID=iSid AND DOB >= StartDate;
   DELETE FROM Table3 ine WHERE StrID=iSid AND DOB >= StartDate;
   DELETE FROM Table4 WHERE StrID=iSid AND DOB >= StartDate;
   DELETE FROM Table5 WHERE StrID=iSid AND DOB >= StartDate;
   DELETE FROM Table6 WHERE StrID=iSid AND DOB >= StartDate;
   DELETE FROM Table7 WHERE StrID=iSid AND DOB >= StartDate;
   DELETE FROM Table8 WHERE StrID=iSid AND DOB >= StartDate;
   DELETE FROM Table9 WHERE StrID=iSid AND DOB >= StartDate;
END
iSid and StartDate are IN parameters for the SP. DOB and StrID have normal indexes on them.

Tables have from a couple hundred thousand records to a couple million records in them and the SP takes about 10mins to complete.

Is there a quicker more efficient way?

TIA

Greg

Options: ReplyQuote


Subject
Written By
Posted
Delete taking a long time to complete
April 29, 2010 12:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.