mysql 删除分区 很慢_mysql分区尾部添加分区非常慢?

本文探讨了MySQL中ALTER TABLE操作的性能瓶颈,重点讲解COPY与INPLACE算法的区别。COPY方法虽然会复制数据,但适合副本已存在的场景;INPLACE则在原地操作,可能导致短暂的元数据锁定,通常支持并发DML。了解这些有助于排查和优化数据库操作速度。
摘要由CSDN通过智能技术生成

。。。建议看看show processlist 你就知道为啥慢了 至于你说的后面几个快,副本已经复制了省去了这个步骤

Performance and Space Requirements

ALTER TABLE operations are processed using one of the following algorithms:

COPY: Operations are performed on a copy of the original table, and table data is copied from the original table to the new table row by row. Concurrent DML is not permitted.

INPLACE: Operations avoid copying table data but may rebuild the table in place. An exclusive metadata lock on the table may be taken briefly during preparation and execution phases of the operation. Typically, concurrent DML is supported.

The ALGORITHM clause is optional. If the ALGORITHM clause is omitted, MySQL uses ALGORITHM=INPLACE for storage engines andALTER TABLE clauses that support it. Otherwise, ALGORITHM=COPY is used.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值