- 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;
推薦閱讀
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- Designing Machine Learning Systems with Python
- JavaScript全程指南
- 在最好的年紀學Python:小學生趣味編程
- Instant Apache Stanbol
- C#編程入門指南(上下冊)
- 圖解Java數據結構與算法(微課視頻版)
- 青少年軟件編程基礎與實戰(圖形化編程三級)
- PHP編程基礎與實例教程
- JavaScript動態網頁編程
- QlikView Unlocked
- .NET 4.0面向對象編程漫談:應用篇
- Machine Learning for OpenCV
- Go語言入門經典
- C語言程序設計實踐