Jump to content

Slow Queries for no clear reason


Infinitive

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.