MySQL中的复制全表到新表

两种方式

1、

create table new_table;

insert into new_table select * from old_table;


2、

create table new_table as select * from old_table;


性能比较


1、

mysql> create table t_1 like t_i;
Query OK, 0 rows affected (0.03 sec)

mysql> 
mysql> insert into t_1 select * from t_i;
Query OK, 956960 rows affected (28.39 sec)
Records: 956960  Duplicates: 0  Warnings: 0


2、

mysql> create table t_2 as select * from t_i;     
Query OK, 956960 rows affected (14.60 sec)
Records: 956960  Duplicates: 0  Warnings: 0


第二种完胜


另,本人参加了leader.us的MySQL Mycat培训教程,网上授课方式,嗯 ,里面的四位老师都是大神,有问题还可以问,顺便学习一下吹牛逼的本事得意。我是第一期,要开第二期了,有兴趣的话。。。加群313658990了解吧。


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值