Understanding of MySQL Database Delay_key_write

Source: Internet
Author: User

MySQL Database parameter delay_key_write:

Delay_key_write refers to the update operation on the table that refers to the new data to the disk before the table is closed, without updating the index to disk and recording the changes to the index in memory. (The purpose of this option is to temporarily stop MySQL from updating the index immediately after each new record is inserted and every modification of the command, and the refresh of the index will wait until all records have been inserted/modified)

This way the MyISAM table can make the index update faster. Update the index to disk together when the table is closed.



When using:1:create table, specify Delay_key_write.

2: When the table already exists: ALTER table table_name delay_key_write= 1.


Scenario: The table has an update operation, the advantages of this parameter will be well reflected. Because this parameter can delay updating the index to the table close. When you update a large table frequently, you can use this parameter



Tip : when Delay_key_write is used, if there is a reboot or power-down, it will cause the index update in the cache to be updated, so you must add--myisam-recover to the startup parameter. This will check your table and synchronize the tables and indexes when you start MySQL. or run Myisamchk before restarting the server. With this feature, apply the--myisam-recover option to start the server and add automatic checks for all MyISAM tables.

Understanding of MySQL Database Delay_key_write

Related Article

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.