开发者

How do I keep this query out of mysql_slowlog?

开发者 https://www.devze.com 2023-02-08 00:42 出处:网络
SELECT count, item, itemid FROM items ORDER BY count DESC LIMIT 20 Takes .0011 Explain: idselect_type tabletypepossible_keyskeykey_len refrows Extra
SELECT count, item, itemid
FROM items
ORDER BY count DESC
LIMIT 20

Takes .0011

Explain:

id  select_type table      type    possible_keys    key     key_len ref        rows Extra  
1    SIMPLE      items      index   NULL             count   4       NULL       20  

I have indexes on itemid(p开发者_JS百科rimary key) and count (INDEX)

Does anyone have suggestions for how this could be better accomplished?


It seems like your long_query_time variable/setting is extremely short. The default is 10 seconds, but if your query is taking 0.0011 seconds, it obviously shouldn't be logged with the default setting. Try increasing it to something reasonable for your setup (1 second+ probably) and see if this still happens.

0

精彩评论

暂无评论...
验证码 换一张
取 消