- 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;
推薦閱讀
- Data Analysis with Stata
- Elasticsearch for Hadoop
- 深入理解Elasticsearch(原書第3版)
- 區塊鏈技術與應用
- Learning Unreal Engine Android Game Development
- LabVIEW虛擬儀器程序設計從入門到精通(第二版)
- Getting Started with Python and Raspberry Pi
- C++從入門到精通(第6版)
- CodeIgniter Web Application Blueprints
- OpenCV Android Programming By Example
- SSH框架企業級應用實戰
- Wearable:Tech Projects with the Raspberry Pi Zero
- ASP.NET本質論
- 軟件再工程:優化現有軟件系統的方法與最佳實踐
- Netty 4核心原理與手寫RPC框架實戰