1)查找垃圾用户(需要根据垃圾用户的特征来判断).
select logintime,userid,sex from hfpet_member where sex='' order by logintime desc;
delete from hfpet_member where sex='' and mid> 8000;
2)查找文档微表中member id 不为空且member id 不是注册用户的文档
文档微表,用于一些轻量的查询!
select * from hfpet_arctiny where mid !='' and mid not in (select mid from hfpet_member) order by id asc;
3)查找没有被审核,且member id 不为空且member id 不是注册用户的文档
select title,mid,ismake from hfpet_archives where ismake='' and mid !='' and mid not in (select mid from hfpet_member);
4)查找没有文档id 的 addonarticle
select * from hfpet_addonarticle where aid not in (select id from hfpet_archives);
删除顺序:
delete from hfpet_member where sex='' and mid> 12000;
delete from hfpet_arctiny where mid !='' and mid not in (select mid from hfpet_member);
delete from hfpet_archives where ismake='' and mid !='' and mid not in (select mid from hfpet_member);
delete from hfpet_addonarticle where aid not in (select id from hfpet_archives);