zoukankan      html  css  js  c++  java
  • MEMORY Storage Engine MEMORY Tables TEMPORARY TABLE max_heap_table_size

    http://dev.mysql.com/doc/refman/5.7/en/create-table.html

    You can use the TEMPORARY keyword when creating a table. A TEMPORARY table is visible only to the current session, and is dropped automatically when the session is closed. This means that two different sessions can use the same temporary table name without conflicting with each other or with an existing non-TEMPORARY table of the same name. (The existing table is hidden until the temporary table is dropped.)

    http://dev.mysql.com/doc/refman/5.7/en/memory-storage-engine.html

    16.3 The MEMORY Storage Engine

    The MEMORY storage engine (formerly known as HEAP) creates special-purpose tables with 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.

    Performance Characteristics

    MEMORY performance is constrained by contention resulting from single-thread execution and table lock overhead when processing updates. This limits scalability when load increases, particularly 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. In particular, the table locking involved with performing updates can slow down concurrent usage of MEMORY tables from multiple sessions.

    Depending on the kinds of queries performed on a MEMORY table, you might create indexes as either the default hash data structure (for looking up single values based on a unique key), or a general-purpose B-tree data structure (for all kinds of queries involving equality, inequality, or range operators such as less than or greater than). The following sections illustrate the syntax for creating both kinds of indexes. A common performance issue is using the default hash indexes in workloads where B-tree indexes are more efficient.

    Physical Characteristics of MEMORY Tables

    The MEMORY storage engine associates each table with one disk file, which stores the table definition (not the data). The file name begins with the table name and has an extension of .frm.

    MEMORY tables have the following characteristics:

    • Space for MEMORY tables is allocated in small blocks. Tables use 100% dynamic hashing for inserts. No overflow area or extra key space is needed. No extra space is needed for free lists. Deleted rows are put in a linked list and are reused when you insert new data into the table. MEMORY tables also have none of the problems commonly associated with deletes plus inserts in hashed tables.

    • MEMORY tables use a fixed-length row-storage format. Variable-length types such as VARCHAR are stored using a fixed length.

    • MEMORY tables cannot contain BLOB or TEXT columns.

    • MEMORY includes support for AUTO_INCREMENT columns.

    • Non-TEMPORARY MEMORY tables are shared among all clients, just like any other non-TEMPORARY table.

  • 相关阅读:
    CodeBlocks背景主题的设置
    Win7更改默认打开方式失败
    BAT命令介绍【转自Internet】
    Index of my articles
    一个表格说明RelativeLayout中的几个重要属性【Written By KillerLegend】
    有史以来最简单的三层实例(C#) ——转载自CSDN
    银联规定的MAC算法_转载
    Windows下ORACLE 10g安装与操作图解
    Oracle 在64位机器上使用PLSQL连接Oracle的问题(SQL * NET not properly installed)转载
    Linux系统下JDK和Tomcat安装配置
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6236900.html
Copyright © 2011-2022 走看看