求助大佬帮忙看看 sql 大约有两百万数据执行批量修改太慢了 有啥优化的好办法码

2020-01-03 18:24:10 +08:00
 chaodada

0
UPDATE `wx_user` SET `member_id` = '378281'  WHERE  login_id='1362' and   vip ='1' and shangji_id='378281'
0
UPDATE `wx_user` SET `member_upgrade_time` = '1578046841'  WHERE login_id='1362' and  `id` = '378284'
1
UPDATE `wx_user` SET `member_id` = '378284' WHERE  login_id='1362' and   id > '378284'  and  `member_id` ='343296' and  `path` LIKE '/0/343264/343296/378284/%'
0
UPDATE `wx_user` SET `member_id` = '378284'  WHERE  login_id='1362' and   vip ='1' and shangji_id='378284'
0
UPDATE `wx_user` SET `member_upgrade_time` = '1578046842'  WHERE login_id='739' and  `id` = '378290'
1
UPDATE `wx_user` SET `member_id` = '378290' WHERE  login_id='739' and   id > '378290'  and  `member_id` ='377382' and  `path` LIKE '/0/314155/374804/377382/378290/%'
0
UPDATE `wx_user` SET `member_id` = '378290'  WHERE  login_id='739' and   vip ='1' and shangji_id='378290'
0
UPDATE `wx_user` SET `member_upgrade_time` = '1578046842'  WHERE login_id='739' and  `id` = '378300'
1
UPDATE `wx_user` SET `member_id` = '378300' WHERE  login_id='739' and   id > '378300'  and  `member_id` ='0' and  `path` LIKE '/0/378300/%'
0
UPDATE `wx_user` SET `member_id` = '378300'  WHERE  login_id='739' and   vip ='1' and shangji_id='378300'
0
UPDATE `wx_user` SET `member_upgrade_time` = '1578046842'  WHERE login_id='739' and  `id` = '378309'
1
UPDATE `wx_user` SET `member_id` = '378309' WHERE  login_id='739' and   id > '378309'  and  `member_id` ='377329' and  `path` LIKE '/0/314155/377329/378309/%'
0
UPDATE `wx_user` SET `member_id` = '378309'  WHERE  login_id='739' and   vip ='1' and shangji_id='378309'
0
UPDATE `wx_user` SET `member_upgrade_time` = '1578046842'  WHERE login_id='1362' and  `id` = '378313'
1
UPDATE `wx_user` SET `member_id` = '378313' WHERE  login_id='1362' and   id > '378313'  and  `member_id` ='343296' and  `path` LIKE '/0/343264/343296/378313/%'
0
UPDATE `wx_user` SET `member_id` = '378313'  WHERE  login_id='1362' and   vip ='1' and shangji_id='378313'
0
UPDATE `wx_user` SET `member_upgrade_time` = '1578046843'  WHERE login_id='739' and  `id` = '378316'
1
UPDATE `wx_user` SET `member_id` = '378316' WHERE  login_id='739' and   id > '378316'  and  `member_id` ='377335' and  `path` LIKE '/0/314155/377335/378316/%'

目前 login_id 加了 index 索引 path 加了一个 fulltext 索引 求大佬帮忙看一下

3843 次点击
所在节点    MySQL
1 条回复
surfire91
2020-01-04 11:22:52 +08:00
login_id 我看都是 739, 筛选性很小?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/634860

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX