How can Mysql: efficiently add fields to a table with millions of rows of data?

use

directly
alter table order_log add outdated int default 0 null;

it hasn"t been over for a long time
is there any way to speed it up?

Nov.09,2021

is best executed when the business is idle. When adding fields requires a large amount of data in the metadata lock, table, it will take a certain amount of time to simply add fields. If the business is busy, lock contention will easily occur during this period, slowing down the execution time of DDL.

Menu