My server spiked again so I ran show processlist and found this query a lot:
Quote:
|
SELECT id,user,userid,cat,storecat,date,title,description,keywords,bigimage,width,height,filesize,views,medwidth,medheight,medsize,approved,rating,allowprint,numcom,lastposter FROM pp_photos WHERE approved < 2 ORDER BY disporder,date DESC
|
Looks like it's very server intensive. after the load calmed I ran it myself twice, and the results pretty shocked me: Showing rows 0 - 29 (263,231 total, Query took 1.9312 sec)
almost 2 seconds! then I ran it again (3rd time after a few mins) and i got 2.5 seconds! what can I do to avoid this query or optimize it? I guess its ordering 262K photos that takes so long, since when I removed it, it was fast (9 micro secs)
Where does such query even exists? notice it doesn't have any terms besides approved < 2...no cat or anything.