Home > Database > Mysql Tutorial > mysql建立索引删除索引很慢的解决_MySQL

mysql建立索引删除索引很慢的解决_MySQL

WBOY
Release: 2016-06-01 13:30:32
Original
3930 people have browsed it

bitsCN.com

mysql建立索引删除索引很慢的解决

 

目前情况

建立索引非常慢,需8分钟...

 

目前环境:

----------------

table行: 30W

版本5.0.45-community-nt

系统XP  CPU2.11G  MEM2G

 

测试语句:

----------------------

CREATE INDEX i_atian  ON gaopinzi(atian)DROP INDEX i_atian ON gaopinzi
Copy after login

解决方法:调整my.ini的参数配制..不个_size统统加大10倍..

----------------------------------------------------

原来

read_buffer_size=64Kread_rnd_buffer_size=256Ksort_buffer_size=203Kinnodb_additional_mem_pool_size=2Minnodb_log_buffer_size=1M[SQL] DROP INDEX i_atian ON gaopinzi
Copy after login

受影响的行: 322750

时间: 459.031s

my.ini 提升10倍数

read_buffer_size=80M

read_rnd_buffer_size=80M

sort_buffer_size=88M

innodb_additional_mem_pool_size=200M

innodb_log_buffer_size=100M

QL] DROP INDEX i_atian ON gaopinzi

受影响的行: 322750

时间: 33.766s

[SQL] CREATE INDEX i_atian  ON gaopinzi(atian)
Copy after login

 

 

受影响的行: 322750

时间: 35.890s

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template