Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the advantages of MySQL 5.7online DDL feature

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 219

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report