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

Lack of Interest [Suggestion] LIMIT to Session Query

Discussion in 'Closed Suggestions' started by DregondRahl, Feb 25, 2011.

  1. DregondRahl

    DregondRahl Member

    Sessions can get quite large for an active community, so it would appropriate i think to add LIMIT 1 to the session query, so it stops searching after it find the one its looking for.

    SELECT session_data, expiry_date
    FROM xf_session
    WHERE session_id = ?
    LIMIT 1
    Its not a major change but for a lot of sessions it can have some improvement.
  2. Mike

    Mike XenForo Developer Staff Member

    The session ID is the primary key anyway (thus unique).
  3. Laric

    Laric Active Member

    But it would have an effect anyhow especially if the mysql server is on another host wouldn't it?
  4. Mike

    Mike XenForo Developer Staff Member

  5. Kier

    Kier XenForo Developer Staff Member

    LIMIT works by doing the query, then extracting a collection of results.

    When the query can only return a single result, by virtue of {unique_key} = {value}, then adding a LIMIT clause could not have any effect whatsoever.
  6. Vladislav Rastrusny

    Vladislav Rastrusny Active Member

  7. DregondRahl

    DregondRahl Member

    Thanks for the input everyone, i guess because its indexed it wouldn't matter. =]

Share This Page