Home > Database > Mysql Tutorial > body text

Introduction to the Memory storage engine of Mysql storage engine

黄舟
Release: 2016-12-22 16:45:11
Original
1385 people have browsed it

Memory storage engine is easy to know by its name. It is a storage engine that stores data in memory. The Memory storage engine does not store any data on the disk, but only stores a .frm file with table structure-related information on the disk. So once MySQL crashes or the host crashes, the Memory table will only have one structure left. Memory tables support indexes, and support indexes in both Hash and B-Tree formats. Because it is stored in memory, Memory stores data in a fixed-length space, and does not support BLOB and TEXT type fields. The Memory storage engine implements page-level locking.

Since all data is stored in memory, its consumption of memory can be imagined. There is such a formula in the MySQL user manual to calculate the actual memory size consumed by the Memory table:

SUM_OVER_ALL_BTREE_KEYS(max_length_of_key + sizeof(char*) * 4)

+ SUM_OVER_ALL_HASH_KEYS(sizeof(char*) * 2)

+ ALIGN(length_of_row+1, sizeof(char*))

The above is the introduction of the Memory storage engine of Mysql storage engine. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template