MEMORY

The MEMORY storage engine (formerly known as HEAP) creates contents that are stored in memory. Because the data is vulnerable to crashes, hardware issues, or power outages, only use these tables as temporary work areas or read-only caches for data pulled from other tables.

MEMORY performance is limited by contention due to single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, especially for statement mixes that include writes.
Despite the in-memory processing for MEMORY tables, they are not necessarily faster than InnoDB tables on a busy server, for general-purpose queries, or under a read/write workload. Particularly, the table locking involved with performing updates can slow down concurrent usage of MEMORY tables from multiple sessions.

The maximum size of MEMORY tables is limited by the max_heap_table_size system variable, which has a default value of 16MB.


Storage Limits
RAM
Transactions No
Locking granularity Table
MVCC No
Geospatial data type support No
Geospatial indexing support No
B-tree indexes Yes
T-tree indexes No
Hash indexes Yes
Full-text search indexes No
Clustered indexes No
Data caches N/A
Index caches N/A
Compressed data No
Encrypted data Yes
Cluster database support No
Replication support Yes
Foreign key support No
Backup/ Point-in-time recovery Yes
Query cache support Yes
Update statistics for data dictionary Yes