Infinitive Posted March 29, 2009 Share Posted March 29, 2009 I'm trying to track some slowness in my system, which I believe is coming from the MySQL db. I started up log-slow-queries to make sense of it and there's a lot of info, but no clear explanations. Some queries are taking much longer than they should for no apparent reason. Like this one: # User@Host: AccountLogin[AccountLogin] @ localhost [] # Query_time: 9 Lock_time: 0 Rows_sent: 0 Rows_examined: 0 DELETE FROM Stored_List WHERE StorageID = 162725; StorageID is in this case the Primary Key. The table's large but not enormous, at under 24,000 rows. And it only has 7 columns. So why should this query take so long to process? Zero rows were examined (because it was based off of a key) and thankfully the lock time was zero. What's the holdup? That's just an easy example, I could find others: an update based off the primary key that takes 18 seconds (different table). Or this Select, off the same table: # User@Host: AccountLogin[AccountLogin] @ localhost [] # Query_time: 7 Lock_time: 0 Rows_sent: 1 Rows_examined: 8 SELECT count(1) AS Items FROM Stored_List WHERE Stored_List.WarehouseID = 3979; Yes it had a couple rows to look at, but 7 seconds to examine 8 rows? I'm still new at this from the analyzing side so I'm trying to make sense of it. I also ran a mysqlreport that looked normal except that com_: change_db was high, and I'm trying to figure out what that means too. Quote Link to comment https://forums.phpfreaks.com/topic/151655-slow-queries-for-no-clear-reason/ Share on other sites More sharing options...
fenway Posted April 1, 2009 Share Posted April 1, 2009 Run the EXPLAIN for each of those. Quote Link to comment https://forums.phpfreaks.com/topic/151655-slow-queries-for-no-clear-reason/#findComment-798570 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.