- MySQL 8 for Big Data
- Shabbir Challawala Jaydip Lakhatariya Chintan Mehta Kandarp Patel
- 127字
- 2021-08-20 10:06:05
NOWAIT and SKIP LOCKED
When rows are locked by other transactions that you are trying to access, then you need to wait for that transaction to release the lock on the same row so that you can access it accordingly. To avoid waiting for the other transaction, InnoDB has added support of the NOWAIT and SKIP LOCKED options. NOWAIT will return immediately with an error in case the requested row is locked rather than going into the waiting mode, and SKIP LOCKED will skip the locked row and never wait to acquire the row lock. Hence, SKIP LOCKED will not consider the locked row in the resulting set:
SELECT * FROM table1 WHERE id = 5 FOR UPDATE NOWAIT;
SELECT * FROM table1 FOR UPDATE SKIP LOCKED;
推薦閱讀
- Vue.js設(shè)計(jì)與實(shí)現(xiàn)
- Hands-On Data Structures and Algorithms with JavaScript
- 我的第一本算法書
- 云計(jì)算通俗講義(第3版)
- Spring實(shí)戰(zhàn)(第5版)
- PhoneGap Mobile Application Development Cookbook
- ArcGIS By Example
- Mastering Data Mining with Python:Find patterns hidden in your data
- MySQL入門很輕松(微課超值版)
- FPGA嵌入式項(xiàng)目開發(fā)實(shí)戰(zhàn)
- BeagleBone Robotic Projects(Second Edition)
- ActionScript 3.0從入門到精通(視頻實(shí)戰(zhàn)版)
- OpenCV Android開發(fā)實(shí)戰(zhàn)
- Java程序設(shè)計(jì)教程
- 算法精解:C語言描述