I am using MySql 5.1.57 version, when i am creating index on one of its table, it locks the inserting records, is there any way for creating index without locking inserting/updating records ?
Asked
Active
Viewed 54 times
1
-
Possible duplicate of [Create an index on a huge mysql production table without table locking](https://stackoverflow.com/questions/4244685/create-an-index-on-a-huge-mysql-production-table-without-table-locking) – Raymond Nijland Jun 30 '17 at 10:40
-
https://dba.stackexchange.com/questions/550/can-i-create-index-on-a-table-in-a-mysql-database-while-in-use – Raymond Nijland Jun 30 '17 at 10:41
1 Answers
1
I can recommend the Percona online schema changer: https://www.percona.com/doc/percona-toolkit/LATEST/pt-online-schema-change.html
I have used this myself successfully on some really big tables. It takes a lot longer than a "normal" change but your operation (i.e. reads and writes) should not be impacted. Be sure to read the documentation thoroughly first though and test with some different configuration parameters to make sure the load does not get too high.

Hans
- 447
- 3
- 10