Jump to content

Slow site


ayok

Recommended Posts

try adding the word "explain" before your select statements. It will tell you which keys (if any) it is/isn't using.

 

example:

mysql> explain select * from members where member_id = 108649;
+----+-------------+---------+-------+---------------+---------+---------+-------+------+-------+
| id | select_type | table   | type  | possible_keys | key     | key_len | ref   | rows | Extra |
+----+-------------+---------+-------+---------------+---------+---------+-------+------+-------+
|  1 | SIMPLE      | members | const | PRIMARY       | PRIMARY | 4       | const |    1 |       |
+----+-------------+---------+-------+---------------+---------+---------+-------+------+-------+

 

you want to look at the column "key" if it is "NULL" you are not using a key, and you should then add one. Paste the query your running, and we can help you choose indexes to use.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/262513-slow-site/#findComment-1345382
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.