Page 2 of 2 First 12
Results 16 to 23 of 23

Click here to go to the first staff post in this thread.
Thread: Forum loading very slowly

  1. #16
    due to a IN (0,1,2) thread state SQL clause, and SQL treats 0,1,2 section as IN 1 OR 2 OR 3, which is incredibly slow for a forum of this size.
    I think this is why you are in charge. I'd be doing this:



    But generally the forum is much, much faster, so thanks for the dark magic you performed.

  2. #17
    Thanks Brett for forgoing the sticky pudding and hammering the SQL into shape!

  3. Click here to go to the next staff post in this thread. #18
    Originally Posted by Rubbernuke View Post (Source)
    I think this is why you are in charge. I'd be doing this:



    But generally the forum is much, much faster, so thanks for the dark magic you performed.
    Hey that's my car!

  4. #19
    Originally Posted by Brett C View Post (Source)
    so slow is due to a IN (0,1,2) thread state SQL clause, and SQL treats 0,1,2 section as IN 1 OR 2 OR 3
    This may be the most stupid question as I am not familiar with VBulletin
    (sorry Brett)
    but normally we would optimise that as a value < 3 SQL clause?

  5. Click here to go to the next staff post in this thread. #20
    Originally Posted by alski View Post (Source)
    This may be the most stupid question as I am not familiar with VBulletin
    (sorry Brett)
    but normally we would optimise that as a value < 3 SQL clause?
    Unfortunately, how vBulletin"looks" at the code, not something that would work - well, easily at least. I'd need to completely refactor the SQL code just to make it work.

    Technically, using INNER JOIN (or LEFT JOIN) would be better over using the IN (0,1,2) for this instance, but ehh - this forum software will be a thing of the past in the coming months.

  6. #21
    Originally Posted by Brett C View Post (Source)
    Technically, using INNER JOIN (or LEFT JOIN) would be better over using the IN (0,1,2) for this instance
    But then this may be using MySQL and that isn't known for making good use of indexes in any but the most trivial queries

  7. This is the last staff post in this thread. #22
    Originally Posted by Shadowdancer View Post (Source)
    But then this may be using MySQL and that isn't known for making good use of indexes in any but the most trivial queries
    Makes me wonder if i should force forumdisplay.com's SQL clause to use a particular index....

  8. #23
    Originally Posted by Brett C View Post (Source)
    Makes me wonder if i should force forumdisplay.com's SQL clause to use a particular index....
    In case of MySQL, forcing it to use an index is more of a suggestion really. When we tried it, the DB would mostly go "yeah, that's a nice index you made" and then continue to do a linear scan.

    It's not the RDBMS the web needs, but the one it deserves.

Page 2 of 2 First 12