Jump to content

Slow site


ayok

Recommended Posts

Hi,

I have a site which is going much slower to download when there are more items. I think it's caused by the queries in the site, but I really don't know which query. Is it the mysql_num_rows? Or searching queries? There is a long "where" filter. Has anyone experienced this? Any suggestions?

 

Thanks,

ayok

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.