将MySQL去重操作优化到极致之三弹连发-创新互联
&nbs在河口等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站制作、成都网站制作 网站设计制作按需制作,公司网站建设,企业网站建设,品牌网站制作,营销型网站建设,外贸网站建设,河口网站建设费用合理。p;
http://blog.csdn.net/wzy0623/article/details/54377986
实验准备:
MySQL 5.6.14
文章题目:将MySQL去重操作优化到极致之三弹连发-创新互联
链接分享:http://pwwzsj.com/article/jdjcd.html
将MySQL去重操作优化到极致之三弹连发(一):巧用索引与变量
http://blog.csdn.net/wzy0623/article/details/54377986
实验准备:
MySQL 5.6.14
- create table t_source
- (
- item_id int,
- created_time datetime,
- modified_time datetime,
- item_name varchar(20),
- other varchar(20)
- );
-
- create table t_target like t_source;
-
- delimiter //
- create procedure sp_generate_data()
- begin
- set @i := 1;
-
- while @i<=500000 do
- set @created_time := date_add('2017-01-01',interval @i second);
- set @modified_time := @created_time;
- set @item_name := concat('a',@i);
- insert into t_source
- values (@i,@created_time,@modified_time,@item_name,'other');
- set @i:=@i+1;
- end while;
- commit;
-
- set @last_insert_id := 500000;
- insert into t_source
- select item_id + @last_insert_id,
- created_time,
- date_add(modified_time,interval @last_insert_id second),
- item_name,
- 'other'
- from t_source;
- commit;
- end
- //
- delimiter ;
-
- call sp_generate_data();
-
- insert into t_source
- select * from t_source where item_id=1;
- commit;
-
- select count(*),count(distinct created_time,item_name) from t_source;
文章题目:将MySQL去重操作优化到极致之三弹连发-创新互联
链接分享:http://pwwzsj.com/article/jdjcd.html