-
Notifications
You must be signed in to change notification settings - Fork 211
MySQL Online DDL
zongfei.fu edited this page Aug 27, 2024
·
2 revisions
goinsight为了避免MySQL改表DDL导致服务不可用,会自动使用gh-ost工具封装DDL语句进行执行。
可以降低大表改表的成本
当前go-ost工具在GA release v1.1.6发行版已经支持了MySQL8.0 ONLINE DDL功能。
如下图:

原理是gh-ost先执行ALTER /* gh-ost */ TABLE %s.%s %s, ALGORITHM=INSTANT
- 执行成功,直接返回
- 执行失败,接着继续按照原方式执行操作
现在您可以在config.yaml配置文件指定参数--attempt-instant-ddl来实现。配置如下图:

最后,记得重启goinsight服务。