MySQL Forums
Forum List  »  InnoDB

Re: Creating sort index cause shared lock
Posted by: Rick James
Date: May 23, 2016 03:05PM

* Change LEFT JOIN to simply JOIN -- unless LEFT is really indicated. (It is definitely not needed for `released`.)

* Start with simply
SELECT @var_tmp_start_date = CASE ...

* Use COALESCE() instead of CASE if practical;

* If this is part of a transaction, either remove it from the transaction or show us more of the transaciton.

* SHOW CREATE TABLE -- we need to make sure you have the optimal indexes.

Note: With those changes and added info, I hope to

* Discover why there is a "shared" lock, and/or

* Speed up the query enough so that the lock is not a serious concern.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Creating sort index cause shared lock
1662
May 23, 2016 03:05PM


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.