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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bdb454-137a6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bdb454-137a6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?