Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql ENABLE KEYS commands takes a long time

Tags:

mysql

I have a MyISAM database table. I'm inserting about 360000 records there, using DISABLE KEYS before and DISABLE KEYS command after data is being inserted. After inserting data to the table ENABLE KEYS commands proceeds, but it takes more than 17 hours on high performance server (currently it is running, and it is 17 hours..). Where the problem can be?

Table has a lot of Indexes, and it was working fine some weeks ago. Is it problem with MySQL server configuration?

like image 649
thesis Avatar asked Nov 15 '22 04:11

thesis


1 Answers

What does your SHOW PROCESSLIST say with respect to the state of your ALTER TABLE table ENABLE KEYS?

Have you changed your MySQL configuration to handle index generation on large tables?

You may have went over a data size threshold in which MySQL changes it's methods to MyISAM index building.

A good blog post to understand/fix/alleviate what's going on:

http://venublog.com/2010/01/04/performance-comparison-of-repair-by-sorting-or-by-keycache/

like image 157
Riedsio Avatar answered Dec 22 '22 19:12

Riedsio