Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the advantages of MySQL 5.7online DDL feature

Shulou Source: shulou.com Published: 2022-05-31 13:58:16 10月27日 Update

This article mainly explains "MySQL 5.7 online DDL features have what advantages", the explanation content in the article is simple and clear, easy to learn and understand, please follow the idea of Xiaobian slowly in-depth, together to study and learn "MySQL 5.7 online DDL features have what advantages"!

The online DDL feature enables many ALTER TABLE operations to avoid duplication of tables and blocking of DML operations during DDL execution.

It has the following advantages:

On a busy production system, when you modify an index or field definition, you may make a table unavailable for a few minutes, a feature that improves database responsiveness and high availability.

This feature allows you to balance performance and concurrency during DDL operations by choosing whether to block access to the entire table (LOCK=EXCLUSIVE statements, allowing neither queries nor DML operations), allow queries but not DML operations (LOCK=SHARED statements), or allow both queries and DML operations (LOCK=NONE statements). When you omit LOCK statements or specify LOCK=DEFAULT, MySQL allows as much concurrency as possible depending on the type of operation.

Avoid large increases in disk I/O stress by performing in-place operations instead of creating copies of the entire table and rebuilds of associated indexes.

--Use INPLACE to add PK

ALTER TABLE add_pk_via_inplace ADD PRIMARY KEY (c1,c2,c3), ALGORITHM=INPLACE;

--Delete index by rebuilding, whether disk space

drop index i_dtyp_big on big_table, algorithm=copy;

Thank you for reading, the above is "MySQL 5.7 online DDL features what advantages" of the content, after the study of this article, I believe we have a deeper understanding of MySQL 5.7 online DDL features what advantages this issue, the specific use of the situation also needs to be verified. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Tags: Features advantages statements indexes learning queries content methods time disks blocking busy stress can make usability at the same time fields that is as much as possible ideas Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia Microsoft Shulou Technology OPPO Reno