ALTER TABLE without locking the table?

后端 未结 19 2103
梦毁少年i
梦毁少年i 2020-11-30 17:41

When doing an ALTER TABLE statement in MySQL, the whole table is read-locked (allowing concurrent reads, but prohibiting concurrent writes) for the duration of the statement

19条回答
  •  孤街浪徒
    2020-11-30 17:57

    See Facebook's online schema change tool.

    http://www.facebook.com/notes/mysql-at-facebook/online-schema-change-for-mysql/430801045932

    Not for the faint of heart; but it will do the job.

提交回复
热议问题