Skip navigation links

MySQL Forums :: Performance :: Locks in slow-query-log


Advanced Search

Locks in slow-query-log
Posted by: Alax James ()
Date: January 15, 2013 01:02AM

Hello,

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,
`level` int,
PRIMARY KEY (`userId`) USING HASH,
) ENGINE=ndbcluster;

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%)
Database :
Users :

Query sample:
SET timestamp=1356056205;
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?

Thanks
Alax



Edited 1 time(s). Last edit at 01/15/2013 02:14AM by Alax James.

Options: ReplyQuote


Subject Views Written By Posted
Locks in slow-query-log 906 Alax James 01/15/2013 01:02AM
Re: Locks in slow-query-log 417 Rick James 01/15/2013 09:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.