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.

  • 相关阅读:
    python全栈开发 * 继承性 层叠性 盒模型 标准文档流 * 180809
    python全栈开发 * css 选择器 浮动 * 180808
    python全栈开发 * 表格标签 表单标签 css 引入方式 * 180807
    python全栈开发 * 线程队列 线程池 协程 * 180731
    saltstack的jinjia模板
    saltstack cmd状态模块和条件判断
    saltstack 配置管理之状态间关系
    saltstack lamp自动化案例实战
    saltstack 配置管理之状态模块
    saltstack 远程执行之返回写入到mysql
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6236900.html
Copyright © 2011-2022 走看看