Hi,
This is my first time creating an issue, so I apologize if I categorized it incorrectly. Some of my website pages were taking a long time to load, so I contacted my host (I have a dedicated server). I wanted to share what they sent back to me:
As of currently this server has a very high load, about 25ish. Upon investigation it appears that mysql was causing most of the load. I noticed that this query was running very frequently and was not using any indexes.
mysql> explain SELECT lid, type, language, priority FROM xmlsitemap WHERE loc = 'node/25931';
+----+-------------+------------+------+---------------+------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+------+---------------+------+---------+------+-------+-------------+
| 1 | SIMPLE | xmlsitemap | ALL | NULL | NULL | NULL | NULL | 24550 | Using where |
+----+-------------+------------+------+---------------+------+---------+------+-------+-------------+
After I added the index
mysql> explain SELECT lid, type, language, priority FROM xmlsitemap WHERE loc = 'node/25931';
+----+-------------+------------+------+---------------+---------+---------+-------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+------+---------------+---------+---------+-------+------+-------------+
| 1 | SIMPLE | xmlsitemap | ref | loc_idx | loc_idx | 765 | const | 1 | Using where |
+----+-------------+------------+------+---------------+---------+---------+-------+------+-------------+
As of currently most of these queries are executing extremely fast and the load has dropped considerably.
----------------
I really appreciate this module. I don't know much about MySQL configurations, but perhaps this report might help someone else. Please let me know if you would like any other information about my situation (server, drupal, etc)
best,
dan
Comments
Comment #1
Anonymous (not verified) commented#544774: Slow queries - add index to loc column
Comment #2
functions commenteddamn, I was three days late from being breaking news.. :)