XF 2.2 Old Zombie Data Before 2.2.7

HappyWorld

Well-known member
Regarding XF Bug here which has been resolved in 2.2.7, old zombie data is not automatically removed during upgrade to 2.2.7.

Is it safe to clean zombie data manually such as :
SQL:
DELETE FROM `xf_thread_read` WHERE thread_id NOT IN (SELECT thread_id FROM xf_thread);
DELETE FROM `xf_thread_user_post` WHERE thread_id NOT IN (SELECT thread_id FROM xf_thread);
DELETE FROM `xf_thread_watch` WHERE thread_id NOT IN (SELECT thread_id FROM xf_thread);

Do i need to rebuild counter (or rebuild anything from admin panel) after cleaning zombie data?

Thanks.
 
I have tried to clean xf_thread_read & xf_thread_watch, and no error this far.

However i have not tried xf_thread_user_post, so i will bump this thread if anyone can help to answer :) (i have 2.4 million zombie data in xf_thread_user_post)
 
It should be safe, but it's not really necessary unless you have a lot of hard-deleted threads--and even then, it's a very small amount of data.

I would recommend against attempting it unless there's a particular issue you're trying to solve and you're experienced with SQL.
 
it's a very small amount of data.
mysql> DELETE FROM xf_thread_read WHERE thread_id NOT IN (SELECT thread_id FROM xf_thread);
Query OK, 14 rows affected (0.03 sec)

mysql> DELETE FROM xf_thread_user_post WHERE thread_id NOT IN (SELECT thread_id FROM xf_thread);
Query OK, 389 rows affected (1.38 sec)

mysql> DELETE FROM xf_thread_watch WHERE thread_id NOT IN (SELECT thread_id FROM xf_thread);
Query OK, 59 rows affected (0.78 sec)
 
Top Bottom