Support » Plugin: WP Visitor Statistics » Very inefficient MySQL queries

  • From what I see the code does full table scan queries like this, pretty much killing MySQL. No goodie. I had to disable the plugin due to this inefficiency.

    SELECT HOUR(CONVERT_TZ(visitLastActionTime,?,?)) AS hour, SUM(totalViews) AS pageViews FROM wp_wsm_pageViews WHERE CONVERT_TZ(visitLastActionTime,?,?) >= ? AND CONVERT_TZ(visitLastActionTime,?,?) <= ? GROUP BY HOUR(CONVERT_TZ(visitLastActionTime,?,?))

    This table was retrieved with a full table scan, which is often quite bad for performance, unless you only retrieve a few rows.
    The table was retrieved with this index: 
    No index was used in this part of the query.
    A temporary table was created to access this part of the query, which can cause poor performance. This typically happens if the query contains GROUP BY and ORDER BY clauses that list columns differently.
    MySQL had to do an extra pass to retrieve the rows in sorted order, which is a cause of poor performance but sometimes unavoidable.
    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 48072 rows of this table were scanned.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Very inefficient MySQL queries’ is closed to new replies.