telc
09-06-2007, 07:05 PM
http://www.vbulletin.com/forum/showthread.php?t=242202
My forum is very large, and when I enabled the slow_query log in mysql. I noticed that searches that match a large # of posts could take a long time to execute. (this is extremly CPU intensive and causes a downward spiral at times)
This is the query that gives me the most trouble, it is in search.php
I had to cut out the postids because the query was over 350,000 characters and too large to post here.
There was over 40,000 matching postids being passed into that "IN" clause.
I do have the search results limit set to 500 in admincp but that does not have any affect on this query.
# Query_time: 16 Lock_time: 0 Rows_sent: 43736 Rows_examined: 87970
SELECT thread.threadid, thread.forumid, post.userid
FROM thread AS thread INNER JOIN post AS post ON(thread.threadid = post.threadid ) WHERE post.postid IN (MANY POST IDS) AND post.visible = 1;
Propasal:
If a users search matches over X number of posts, the user could be prompted to refine the query.
It would be nice if X this could be an admincp setting, it would stop large #'s of postid's from being passed into that "IN" clause.
My forum is very large, and when I enabled the slow_query log in mysql. I noticed that searches that match a large # of posts could take a long time to execute. (this is extremly CPU intensive and causes a downward spiral at times)
This is the query that gives me the most trouble, it is in search.php
I had to cut out the postids because the query was over 350,000 characters and too large to post here.
There was over 40,000 matching postids being passed into that "IN" clause.
I do have the search results limit set to 500 in admincp but that does not have any affect on this query.
# Query_time: 16 Lock_time: 0 Rows_sent: 43736 Rows_examined: 87970
SELECT thread.threadid, thread.forumid, post.userid
FROM thread AS thread INNER JOIN post AS post ON(thread.threadid = post.threadid ) WHERE post.postid IN (MANY POST IDS) AND post.visible = 1;
Propasal:
If a users search matches over X number of posts, the user could be prompted to refine the query.
It would be nice if X this could be an admincp setting, it would stop large #'s of postid's from being passed into that "IN" clause.