Can anyone please tell the difference between the following sql,
SELECT * FROM TABLE
VS
SELECT * FROM TABLE FOR UPDATE
When and at what situation i need to use For Update
It is taking more time for getting the data if i use update and getting stopped. What is happening on Update to increase the time. Please tell me the entire process happening on this.
I think the sentence from the MariaDB / MySQL manual is self-explanatory:
If you use FOR UPDATE with a storage engine that uses page or row locks, rows examined by the query are write-locked until the end of the current transaction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With