Jump to content

Recommended Posts

Your mysql server admin will have to enable the 'slow query log' option in my.cnf and mysql will start logging    slow queries to a log file, server admin will then be able to extract out the queries related to your db.

 

 

reference :-

 

http://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html

Link to comment
https://forums.phpfreaks.com/topic/99606-too-many-queries/#findComment-509832
Share on other sites

I don't know what "other things" you are talking about ....

 

this is just what my server said:

"Enabling this log would be a global change at the root of the server and you won't have access to the log file."

 

 

the one on the home page is like this

SELECT *,
	DATEDIFF(DATE(vip), CURDATE()) AS 'days_left'
FROM members
WHERE DATEDIFF(DATE(vip), CURDATE())>0
	AND friendid NOT IN ($featuredspaces)
ORDER BY DATEDIFF(DATE(vip), CURDATE()) DESC

 

and with explain it said..

 

id select_type table type possible_keys key key_len ref rows Extra

1 SIMPLE members ALL NULL NULL NULL NULL 79011 Using where; Using temporary; Using filesort

 

 

 

and on the add page

SELECT friendid, name, picture, points,
DATEDIFF(DATE(vip), CURDATE()) as 'vip' FROM members
WHERE friendid NOT IN
(SELECT theirs FROM added WHERE yours='{$_SESSION['friendid']}')
AND friendid != '{$_SESSION['friendid']}'
ORDER BY (DATEDIFF(DATE(vip), CURDATE())>0) DESC, points DESC, lastlogin DESC LIMIT $limit

 

and the explain for that

 

id select_type table type possible_keys key key_len ref rows Extra

1 PRIMARY members ALL NULL NULL NULL NULL 79013 Using where; Using temporary; Using filesort

2 DEPENDENT SUBQUERY added ALL NULL NULL NULL NULL 3216 Using where

 

Link to comment
https://forums.phpfreaks.com/topic/99606-too-many-queries/#findComment-512484
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.