Where is this query called from?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • telc
    Senior Member
    • Oct 2001
    • 239
    • 3.5.x

    Where is this query called from?

    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 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.

    Code:
    # 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 ([B]MANY POST IDS[/B]) 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.
    Last edited by telc; Sat 10 Nov '07, 5:11pm.
  • telc
    Senior Member
    • Oct 2001
    • 239
    • 3.5.x

    #2
    Anyone know? I grep'ed the code I can't find this query.

    Comment

    • telc
      Senior Member
      • Oct 2001
      • 239
      • 3.5.x

      #3
      Here is a screenshot of the query, it is too large to post. The screenshot only captures part of it, it scrolls for several more pages.
      Attached Files

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...