MySQL5.7 Enhanced online DDL (varchar character set)

Source: Internet
Author: User

In MySQL5.6, the online DDL was introduced, the Add field and the secondary index do not lock the table, but the Modify field property is the lock table. See: http://hcymysql.blog.51cto.com/5223301/1370546


Now in MySQL5.7, the modified varchar field property is not locked in the table, for example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/51/wKiom1RPWeKAI_hiAAK7Edk4nfs132.jpg "title=" 1.jpg " alt= "Wkiom1rpwekai_hiaak7edk4nfs132.jpg"/>


1 million rows of table, now to the pad varchar (65) modified to pad varchar (80), you can see, do not copy the data without locking the table.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4D/51/wKiom1RPWozBgsimAADG3ngstpM003.jpg "title=" 2.jpg " alt= "Wkiom1rpwozbgsimaadg3ngstpm003.jpg"/>

(Note: algorithm specifies the algorithm to create or delete an index, and copy represents a temporary table created in accordance with the method prior to MySQL version 5.1.) InPlace indicates that creating an index or deleting an index does not require creating a temporary table. The default means that the parameter old_alter_table is determined by the inplace or copy algorithm, and the parameter defaults to OFF, indicating the way to use InPlace. )


However, if it is greater than and equal to varchar (256) or the varchar (80) is reduced to varchar (40), it is still necessary to copy the data and lock the table, see:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4D/52/wKioL1RPW6XzYoWWAAEEOnV6HIg841.jpg "style=" float: none; "title=" 3.jpg "alt=" Wkiol1rpw6xzyowwaaeeonv6hig841.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4D/51/wKiom1RPXCqhVdI-AAEP5W8e2Pc967.jpg "title=" 4.jpg " alt= "Wkiom1rpxcqhvdi-aaep5w8e2pc967.jpg"/>


Reference:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/51/wKiom1RPXGHw_vOAAAQrwxQQrc4177.jpg "title=" 5.jpg " alt= "Wkiom1rpxghw_voaaaqrwxqqrc4177.jpg"/>


BTW:

MySQL5.7 also support changing the index name, but the practicality is not high, who is free to change the name of the index? Cases:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/52/wKioL1RPYh6D6x-jAAK-ZnVnN4A255.jpg "style=" float: none; "title=" 6.jpg "alt=" Wkiol1rpyh6d6x-jaak-znvnn4a255.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/52/wKiom1RPYciRcsR-AAK5z6fs-bw004.jpg "style=" float: none; "title=" 7.jpg "alt=" Wkiom1rpycircsr-aak5z6fs-bw004.jpg "/>



This article is from the "Spring Yang Technical column" blog, please be sure to keep this source http://hcymysql.blog.51cto.com/5223301/1568929

MySQL5.7 Enhanced online DDL (varchar character set)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.