MySQL Forums
Forum List  »  InnoDB

Lock wait timeout exceeded; try restarting transaction error - do I need a different index?
Posted by: Shaun Thomson
Date: February 23, 2018 02:04AM

Hi

I have a table of about 50 million rows, on which I'm applying the following query:

DELETE FROM `myTable`WHERE ( myID, theirID ) IN (("333335412","38645"), (("333335412","772288"),(("333335412","44436"));

...only there are 5000, not 3 entries in the query.

My table has a two column index over myID and theirID (BTREE)

I'm getting the following error often:

Lock wait timeout exceeded; try restarting transaction error - some of the queries are taking 140 seconds or longer

I would have thought a delete would be a lot faster than that - should I be using a different index to speed things up?

Thanks for your time and help.

Options: ReplyQuote


Subject
Views
Written By
Posted
Lock wait timeout exceeded; try restarting transaction error - do I need a different index?
9764
February 23, 2018 02:04AM


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.