at
row,将提示信息的 pre_common_member 、 pre_common_member_status 这两个表的归档表删除,并以主表为基准手工
新建了两个和主表数据一致的归档表,然后自动执行计划任务的每日用户表优化就正常了,但是如此操作之后会造成 UC 中心的用户总数与论坛显示的会员总数不一
致的情况,这个时候可以尝试将存档表合并到主表中,需要执行的 sql 语句如下:
- insert into pre_common_member select * from pre_common_member_archive;
- insert into pre_common_member_count select * from pre_common_member_count_archive;
- insert into pre_common_member_field_forum select * from pre_common_member_field_forum_archive;
- insert into pre_common_member_field_home select * from pre_common_member_field_home_archive;
- insert into pre_common_member_profile select * from pre_common_member_profile_archive;
- insert into pre_common_member_status select * from pre_common_member_status_archive;
再执行:
- TRUNCATE TABLE `pre_common_member_archive`;
- TRUNCATE TABLE `pre_common_member_count_archive`;
- TRUNCATE TABLE `pre_common_member_field_forum_archive`;
- TRUNCATE TABLE `pre_common_member_field_home_archive`;
- TRUNCATE TABLE `pre_common_member_profile_archive`;
- TRUNCATE TABLE `pre_common_member_status_archive`;
这样就可以了。