MySQL Forums
Forum List  »  InnoDB

Re: Getting "Lock wait timeout exceeded;" when using "for update"
Posted by: Rick James
Date: June 08, 2011 12:01AM

> Could the 2 indexes at the end be increasing the chances of locks when doing 'for update'?
I don't think so.

> the PK should be included in all indexes?
Correction...
The PK is implicitedly included in all indexes?
A lookup by a secondary key, for example `userid`, will use the PK to find the actual row.

Think of it as two BTree-organized tables, one with (userid, id), the other with the real row: (id, ...)

Options: ReplyQuote




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.