1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Question about this slow query

Discussion in 'XenForo Questions and Support' started by imthebest, Feb 23, 2015.

  1. imthebest

    imthebest Formerly Super120


    The following slow query got logged:

    # Query_time: 3.090897  Lock_time: 0.000024 Rows_sent: 25  Rows_examined: 224672
    SET timestamp=1424548851;
    SELECT thread.*
      user.*, IF(user.username IS NULL, thread.username, user.username) AS username,
      NULL AS thread_read_date,
      0 AS thread_is_watched,
      0 AS user_post_count
      FROM xf_thread AS thread
      LEFT JOIN xf_user AS user ON
      (user.user_id = thread.user_id)
      WHERE (thread.node_id = 149) AND (thread.sticky = 0) AND (thread.discussion_state IN ('visible'))
      ORDER BY thread.title DESC
      LIMIT 25 OFFSET 74350;
    May I know what produces this slow query?

  2. Mike

    Mike XenForo Developer Staff Member

    Displaying page (I believe) 2973 of a forum ordered by titles.
  3. imthebest

    imthebest Formerly Super120

    Is it normal to have a query of 3 seconds for that simple operation?

    Although it's the first and only occurrence of that slow query... maybe at the time my SSD was busy.
  4. Mike

    Mike XenForo Developer Staff Member

    Due to how MySQL works, that won't be a particularly fast query (getting all the records, sorting them, then throwing away the data it doesn't need).

Share This Page