修改mysql配置的影响

最初安装mysql时,用的是开发者模式,内存开的比较小,后面又配置一下,内存开大了,看看效果。

my.ini里有区别的配置:

配置项修改后原值
tmp_table_size17917
myisam_sort_buffer_size
35734
key_buffer_size
30825
innodb_additional_mem_pool_size
132
innodb_log_buffer_size
71
innodb_buffer_pool_size
59746

====================================================================================
重新配置了mysql,开大了各个内存。
创建索引,一千万数据,两列复合索引,用时23分钟左右。
原来要1.5小时左右。


mysql> alter table tb_2 add index last_first (lastName,firstName);
Query OK, 10000000 rows affected (23 min 40.20 sec)
Records: 10000000  Duplicates: 0  Warnings: 0
====================================================================================
mysql> select * from tb_2 where birthday='2000-02-29';
250 rows in set (10.53 sec)
mysql> select * from tb_2 where birthday='2000-02-29';
247 rows in set (6.86 sec)
mysql> select * from tb_2 where birthday='1908-01-29';
252 rows in set (6.81 sec)


重新配置了mysql,开大了各个内存。对birthday索引,用时26分钟左右。
原来要3.5个小时。不过这里的数据是排过序的。


mysql> create index birthdayIndex on tb_2 (birthday);
Query OK, 10000000 rows affected (25 min 59.08 sec)
Records: 10000000  Duplicates: 0  Warnings: 0


索引后提速几百倍。
mysql> select * from tb_2 where birthday='2000-02-29';
250 rows in set (0.00 sec)
mysql> select * from tb_2 where birthday='1908-01-29';
252 rows in set (0.03 sec)
mysql> select * from tb_2 where birthday='1908-01-29';
252 rows in set (0.00 sec)
====================================================================================

修改配置后,生成索引的速度提升明显。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值