Help Center/ Relational Database Service_RDS for MariaDB/ FAQs/ Database Usage/ Does the OPTIMIZE TABLE Operation Lock Tables on an RDS for MariaDB Instance?
Updated on 2025-06-24 GMT+08:00

Does the OPTIMIZE TABLE Operation Lock Tables on an RDS for MariaDB Instance?

When the OPTIMIZE TABLE operation is performed on an RDS DB instance, the tables are locked only for a short period of time. During the table locking period, DML operations can be performed but DDL operations cannot. DML will recreate tables, which consumes CPU and disk resources. If there are a large number of concurrent DML operations, the table will be locked for longer. To avoid impacting services, perform the OPTIMIZE TABLE operation during off-peak hours.