MySQL Forums
Forum List  »  Performance

Re: Eliminate filesort in update query
Posted by: Rick James
Date: September 24, 2014 08:40PM

(And post the bug number in this thread.)

To assure atomicity...

BEGIN;
SELECT id INTO @id ... LIMIT 1 FOR UPDATE;
UPDATE ... WHERE id = @id;
COMMIT;

This would need to be done in PHP, a Stored Procedure, or some other suitable language.

Options: ReplyQuote


Subject
Views
Written By
Posted
2489
September 23, 2014 02:48AM
1007
September 23, 2014 09:59PM
941
September 24, 2014 01:25AM
Re: Eliminate filesort in update query
984
September 24, 2014 08:40PM
988
September 25, 2014 05:48AM
920
September 26, 2014 04:39PM
970
October 01, 2014 06:49AM
985
October 03, 2014 10:09PM
1019
October 04, 2014 03:13AM


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.