MySQL Forums
Forum List  »  Performance

Re: Delete query not using index and cause deadlock
Posted by: Øystein Grøvlen
Date: August 25, 2015 02:57AM

Rick James Wrote:
-------------------------------------------------------
> Øystein, I do not know if the query engine sorts
> the ids before acquiring row locks. But that
> _might_ be a deadlock-prevention feature.

I do not think query engines sorts to avoid deadlocks, but multi-range read (MRR) and batched key-access (BKA) will imply that keys are sorted before access. However, it will depend on the size of the buffers involved (e.g., join buffer) whether all rows are accessed in a single scan or not.

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Delete query not using index and cause deadlock
1740
August 25, 2015 02:57AM


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.