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

Database Question

Discussion in 'XenForo Questions and Support' started by kuyenmotdivad, Mar 10, 2011.

  1. kuyenmotdivad

    kuyenmotdivad Active Member


    In the database there are these tables is it safe to empty them?
    • attachment_view
    • session
    • session_activity
    • thread_view
    Thanks for any reply
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    To the best of my knowledge, yes it is safe to empty those tables. Why do you want to empty them?

    attachment_view and thread_view store views for attachments and threads which are processed every hour by this cron:

    Admin CP -> Tools -> Cron Entries -> Update View Counters

    So emptying those two tables will rob threads and attachments of their most recent views.

    Emptying the session table will logout everyone who is currently logged in. If the user selected Stay logged in when they logged in then they will be automatically logged in again as if they were never logged out.

    I am less sure about the implications of emptying the session_activity table. It's probably safe, but it might affect features that rely on user.last_activity in that some users will be robbed of their most recent last_activity time.
  3. Mike

    Mike XenForo Developer Staff Member

    Jake is right. Don't empty them unless you have a really good reason to.
  4. kuyenmotdivad

    kuyenmotdivad Active Member

    Thanks for the replies guys....I'll leave them
  5. kuyenmotdivad

    kuyenmotdivad Active Member

    is it safe to empty table?
    • search
    • search_index
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Not if you want to be able to search.

    Why do you want to empty these tables?
    Is there a particular reason?
  7. kuyenmotdivad

    kuyenmotdivad Active Member

    search_id starts at 2, 3 and 4 and not 1 in auto increment, is there a cron job that clears the search table as i got entries in search table from 2,3 and 4 and not 1?
  8. Brogan

    Brogan XenForo Moderator Staff Member

    The search_id is continuously incremented, every time someone clicks on Whats New for example.
  9. kuyenmotdivad

    kuyenmotdivad Active Member

    so it would be safe to empty the search table
  10. Brogan

    Brogan XenForo Moderator Staff Member

    Search results are only retained for a day anyway so you can if you want but it really serves no purpose.
  11. kuyenmotdivad

    kuyenmotdivad Active Member

    Don't think i'll bother then, thanks

Share This Page