is below query normal it sometimes takes 27 seconds on some big forum sections which kills performance like crazy
from what i understand it only counts number of threads in certain forums
yes there are alot of threads on my forum but is there anything i can do to optimize this query, there is 1 more but i can live with the other.
Somehow i feel like noone can help me.
PHP Code:
SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > 1253852688 AND open <> 10, 1, 0)) AS newthread
FROM thread AS thread
WHERE forumid = 1220
AND sticky = 0
AND visible IN (0,1,2)
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE thread range forumid forumid 6 119685 Using where
Time Before: 0.24812 seconds
Time After: 3.76783 seconds
Time Taken: 3.51971 seconds