Skip to content

class-wp-statistics-install.php - no index for field "ip" at table useronline & visitor #414

Description

@sufehmi

Hi, a client of mine recently contacted me and reported that their website was down. After checking everything, I found out that the MySQL server is overloaded with the following queries:

SELECT `location` FROM wp_statistics_visitor WHERE ip = '88.88.88.88' 

SELECT * FROM wp_statistics_useronline WHERE ip = '99.99.99.99'     

I checked, and turned out there's no index for those fields.

So I execute the following command in MySQL :

alter table wp_statistics_useronline add index (ip);
alter table wp_statistics_visitor add index (ip);

And in an instant the website was up again, and CPU utilization in both webserver & database server went down to almost zero.

FYI, thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions