Locks in slow-query-log
Date: January 15, 2013 01:02AM
I am using NDB cluster7.1 and I have a table as below,
CREATE TABLE `storeInfo` (
`userId` varchar(50) NOT NULL,
`logo` varbinary(2000) NOT NULL,
PRIMARY KEY (`userId`) USING HASH,
And my test case is SELECT query, no update/insert/delete.
When enable slow log and check it, I got result as below,
Count : 388.07k (72.35%)
Time : 45334.773877 s total, 116.821 ms avg, 184 us to 1.247777 s max (72.36%)
95% of Time : 39639.928 s total, 107.522 ms avg, 184 us to 226.178 ms max
Lock Time (s) : 14047.256179 s total, 36.198 ms avg, 30 us to 1.175175 s max (72.69%)
95% of Lock : 10990.67843 s total, 29.812 ms avg, 30 us to 108.103 ms max
Rows sent : 1 avg, 0 to 1 max (38.88%)
Rows examined : 1 avg, 0 to 1 max (28.57%)
SELECT logo FROM storeInfo WHERE userId ='10010011010';
My question is WHY so much lock and some of them is 1+ second?
Why the query spend so much time to get a read-lock?
How to reduce these locks?
Edited 1 time(s). Last edit at 01/15/2013 02:14AM by Alax James.