码迷,mamicode.com
首页 > 其他好文 > 详细

高效update方案

时间:2017-10-28 14:31:48      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:批量更新   方案   索引   comm   creat   name   select   高效   rename   

--方案1:
如果有索引,先把索引删除后,再update,最后把索引重新创建一下
因为索引对update影响很大。

--方案2:
1.create table newA as select id,name,age+1 age from A;
2.drop table A;
3.rename newA to A

--方案3:
set autocommit 1000;
update table_name set age=age+1;

--方案4:
批量更新

高效update方案

标签:批量更新   方案   索引   comm   creat   name   select   高效   rename   

原文地址:http://www.cnblogs.com/huangbiquan/p/7746795.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!