Database Question


Well-known 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

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.


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?


Well-known 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?