Bug #117421 | Redundant row-level locking for using order DESC | ||
---|---|---|---|
Submitted: | 10 Feb 8:57 | Modified: | 12 Feb 0:29 |
Reporter: | Link li | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S5 (Performance) |
Version: | 8.0.32 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[10 Feb 8:57]
Link li
[10 Feb 12:01]
MySQL Verification Team
Hi Mr. li, Thank you for your bug report. However, this is not a bug. When index is not unique, InnoDB also has to lock space between the adjacent records. This is all explained in our Reference Manual, which you can find on: https://dev.mysql.com/doc/refman/8.0/en/ Not a bug !!!!
[10 Feb 12:31]
Link li
so it means record lock won't happen in non-unique index ,right?
[10 Feb 12:31]
Link li
so it means record lock won't happen in non-unique index ,right?
[10 Feb 13:36]
MySQL Verification Team
Hi Mr. li, Of course that locks are also taken on unique index, but not the gap locks. With unique index you can get only two types of gap locks. Infimum and supremum locks. Please, read the Reference Manual.
[11 Feb 12:01]
MySQL Verification Team
Hi, I have one more addition to my previous answer. There are cases where gap locks can be taken for unique index. Imagine unique index on the INT column, with valued 3, 22, 143, 1055. These are all unique values, but there are still gaps !!!!!
[12 Feb 0:29]
Link li
OK, tks, I get it.