PDA

View Full Version : Query taking a long time to run


nsanden
02 Aug 2008, 18:44
This query in memberlist.php line 527 showed up in mysql slow query log (for good reason apparently...)

Has anyone else had this problem? Our vb3user table is only 17k rows.


Showing rows 0 - 49 (50 total, Query took 25.2542 sec)
SQL query:
SELECT user . * , usertextfield . * , userfield . * , user.userid, options,
IF (
displaygroupid =0, user.usergroupid, displaygroupid
) AS displaygroupid, infractiongroupid, avatar.avatarpath, NOT ISNULL(
customavatar.userid
) AS hascustomavatar, customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight,
IF (
(
options &512
AND user.userid <>0
), 1, lastactivity
) AS lastvisittime
FROM vb3user AS user
LEFT JOIN vb3usertextfield AS usertextfield ON ( usertextfield.userid = user.userid )
LEFT JOIN vb3userfield AS userfield ON ( userfield.userid = user.userid )
LEFT JOIN vb3avatar AS avatar ON ( avatar.avatarid = user.avatarid )
LEFT JOIN vb3customavatar AS customavatar ON ( customavatar.userid = user.userid )
WHERE 1 =1
AND user.usergroupid
IN (
-1, 6, 7, 2, 5, 19
)
ORDER BY user.username ASC
LIMIT 0 , 50

nexialys
03 Aug 2008, 04:08
this query is executed in 0.005sec in most cases, so i suppose you have some problem with your tables that are not optimized...

or

you installed some hack that is interacting with the system...