TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    MySQL

    MySQL MEMORY Storage Engine

    Overview

    In this tutorial, we will learn about the MEMORY storage engine in MySQL.  MEMORY storage engine tables are temporary in the sense that their contents disappear when the server terminates. The tables still exists when the server restarts, but will be empty.

    MEMORY Storage Engine

    MEMORY storage engine uses tables that are stored in memory and that have fixed-length rows. The MEMORY storage engine manages tables that have the following characteristics:

    • Table data and indexes area stored in memory
    • In-memory storage results in fast performance
    • Table data is lost if the server shuts down. Table structure survives server restart.
    • MySQL manages query contention using table-level locking. Deadlocks cannot occur.
    • Memory tables cannot contain TEXT or BLOB columns.

    ENGINE=MEMORY

    We can create tables using the ENGINE=MEMORY option to use the MEMORY storage engine in the CREATE TABLE statement.

    mysql> CREATE TABLE temptable (
    -> id INT NOT NULL,
    -> name CHAR(40) NOT NULL
    -> )
    -> ENGINE = MEMORY;
    Query OK, 0 rows affected (0.01 sec)

     

    MySQL MEMORY Storage Engine

    Memory storage table contents do not survive a restart of the server. However, the table structure remains with no rows.

     

    MEMORY Storage MySQL Server Restart

    The MEMORY storage engine was formerly called the HEAP engine. We might still use the HEAP option in older SQL code, and MySQL  Server recognizes for backward compatibility.

    MEMORY storage engine tables are limited by max_heap_table_size so they do not get too large.

    mysql> SHOW VARIABLES LIKE ‘%max_heap_table%’;
    +———————+———-+
    | Variable_name | Value |
    +———————+———-+
    | max_heap_table_size | 16777216 |
    +———————+———-+
    1 row in set (0.01 sec)

    MySQL Max Heap Table Size

    —

    MySQL Tutorials

    MySQL Tutorials on this website:

    https://www.testingdocs.com/mysql-tutorials-for-beginners/

    For more information on MySQL Database:

    https://www.mysql.com/

    Related Posts

    Stellar Converter for Database Tool

    MySQL /

    Stellar Converter for Database

    Stellar MySQL Log Analyzer

    MySQL /

    Stellar Log Analyzer for MySQL

    Stellar Repair for MySQL

    MySQL /

    Stellar Repair for MySQL

    MySQL /

    How to secure your SQL Database: Tips and Tricks

    Stellar Converter for Database

    MySQL /

    Database Converter Tools

    ‹ MySQL MyISAM Storage Engine› MySQL GROUP BY ROLLUP Modifier

    Recent Posts

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com