recently, I have been looking at the lock mechanism related to Mysql. There are a few questions that have not been understood. I would like to ask you,
1, Mysql intentional lock and specific exclusive lock / shared lock. Is the purpose of intentional lock only to reduce the conflicting judgment of acquiring shared lock / exclusive lock in row lock? Just to make a prejudgment?
2, select * from table where idex = 1 for update is this intentional lock or record lock? Or is there both, the intention lock first and then record the lock? If idex is Between 1 AND 5, do GAP locks and intention locks coexist? Of course, this is under RR-level transaction isolation.
3. In select from table where idx between 1 and 5 for update, we should actually use NExt-Key locks, so is our commonly used select from table where idx between 1 and 5 the snapshot read in MVCC or the lock type of the current Next_key?