Detailed description of MySQL parameter DELAY_KEY_WRITE

Source: Internet
Author: User

MySQL parameter DELAY_KEY_WRITEThe related knowledge is what we will introduce in this article. DELAY_KEY_WRITE refers to the update operation of the table to the disk without updating the index to the disk before the table is closed, record the index changes in the memory. In this way, the MyISAM table can make index updates faster. When the table is closed, the index is updated to the disk.

Usage:When creating table, specify DELAY_KEY_WRITE.

When the TABLE already exists: alter table table_name DELAY_KEY_WRITE = 1.

Applicability:The table has an update operation, and the advantages of this parameter will be well reflected. Because this parameter can delay updating the index to the table. When we need to update a large table frequently, we can consider using this parameter.

Note:When will table shutdown occur? You can understand that when the flash table is used, the table will be closed. In either case, flush table will occur:

When the cache is full and a new thread tries to open a table, the table is not in the cache;

When the number of tables in the cache is more than that in table_cache, thread does not use the table;

In both cases, the table is flushed.

Of course, you can also set the start parameter flush_time to set the flush table time.

Note that:When DELAY_KEY_WRITE is used, if a restart or power loss occurs, the index update in the cache cannot be updated. Therefore, you must add -- myisam-recover to the startup parameter, in this way, when you start mysql, you will check your table and synchronize the table and index. or run myisamchk before restarting the server. (However, even in this case, use DELAY_KEY_WRITE to ensure that data is not lost, because the keyword information can always be generated from the data row ). If you use this feature, you apply the -- myisam-recover option to start the server and add automatic checks for all MyISAM tables.

Here is an introduction to MySQL parameter DELAY_KEY_WRITE. I hope this introduction will be helpful to you!

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.