New answers tagged locking
Two seeks, and lock on PK, select id from Accounts WITH (UPDLOCK) where id = (select a.id from Accounts a where a.OwnerId=1)
What makes you think your session is waiting? When a statement uses the CPU, it is not waiting. There is no wait event that accounts for using the CPU for processing. People often forget this. Your session is most likely using the CPU. There is no indication in your output that your session is waiting. V$SESSION SECONDS_IN_WAIT If the session is ...
You can query the dynamic performance view V$SESSION_WAIT Like the following: select sid, seq#, EVENT, WAIT_CLASS, SECONDS_IN_WAIT from v$session_wait where sid=<SESSION_SID> Take a look at the 'EVENT' field.
If a transaction has been running 837 seconds, I suggest that its is poorly designed. I don't like a transaction to last even 5 seconds, much less the default innodb_lock_wait_timeout=50. Can't wait for user - A transaction should not include any user interaction. Waiting for a user might mean waiting for him/her to take a phone call. If you need ...
Top 50 recent answers are included