Can I use pt-online-schema-change to change a prim

2019-07-28 18:57发布

I'm considering using pt-online-schema-change to ALTER a primary key (changing it from one column, to a composite primary index) of a table. Are there any limitations to doing this? The documentation states

In most cases the tool will refuse to operate unless a PRIMARY KEY or UNIQUE INDEX is present in the table. See --alter for details.

1条回答
戒情不戒烟
2楼-- · 2019-07-28 19:19

Well, don't do that. Running pt-online-schema-change on a table w/o a single column unique index, may result in a loss of data. See #3 here: http://www.pythian.com/blog/important-caveats-when-using-pt-online-schema-change/

查看更多
登录 后发表回答