Slow dashboard widget query
-
Reviewing my NewRelic performance logging reports, I noticed that a particular query is the slowest to execute among all of the MySQL queries over 7 days at a stretch. I believe it traces back to the dashboard widget. I’ve disabled the widget to see what impact that may have over the next 7 days. It may just be the fact that we have almost 11,000 email log entries.
Here’s what NewRelic is telling me about this query:
SELECT email_data FROM mail_bank_email_logs ORDER BY id DESC 6.48 s 06/19 13:23
SELECT email_data FROM mail_bank_email_logs ORDER BY id DESC 6.05 s 06/18 12:04
SELECT email_data FROM mail_bank_email_logs ORDER BY id DESC 5.98 s 06/18 18:38
SELECT email_data FROM mail_bank_email_logs ORDER BY id DESC 5.88 s 06/18 13:48
SELECT email_data FROM mail_bank_email_logs ORDER BY id DESC 5.48 s 06/17 13:16Query: SELECT email_data FROM mail_bank_email_logs ORDER BY id DESC
Table: mail_bank_email_logs
• This table was retrieved with an index scan, which is like a full table scan, except it only hits the index (not the actual table). This is usually not great for performance.
• The table was retrieved with this index: PRIMARY
• You can speed up this query by querying only fields that are within the index. Or you can create an index that includes every field in your query, including the primary key.
• Approximately 8891 rows of this table were scanned.Stack trace
/wp-includes/wp-db.php (1924)
/wp-includes/wp-db.php (1813)
/wp-includes/wp-db.php (2488)
/wp-content/plugins/wp-mail-bank/lib/dashboard-widget.php (27)
/wp-content/plugins/wp-mail-bank/wp-mail-bank.php (250)
/wp-admin/includes/template.php (1063)
/wp-admin/includes/dashboard.php (218)
/wp-admin/index.php (134)By the way, we do have Redis enabled on our server, if that information is useful in any way.
The page I need help with: [log in to see the link]
The topic ‘Slow dashboard widget query’ is closed to new replies.