Support » Plugin: WP Mail SMTP Plugin with Email Logs » Slow dashboard widget query

  • Resolved intechra

    (@intechra)



    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:16

    Query: 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]

Viewing 1 replies (of 1 total)
  • Plugin Author Varun Sharma

    (@contact-banker)

    Hi,

    Thank you for the feedback.

    This is a known issue and we are working on optimizing the database in future.

    We will release the version in upcoming weeks with a solution!

    Thanks

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.