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
2471
September 23, 2014 02:48AM
1002
September 23, 2014 09:59PM
933
September 24, 2014 01:25AM
Re: Eliminate filesort in update query
977
September 24, 2014 08:40PM
975
September 25, 2014 05:48AM
916
September 26, 2014 04:39PM
967
October 01, 2014 06:49AM
982
October 03, 2014 10:09PM
1015
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.