Home  >  Article  >  Database  >  MySQL内存表_MySQL

MySQL内存表_MySQL

WBOY
WBOYOriginal
2016-06-01 13:06:041538browse

1 内存表简介

    MySQL的内存表,表结构创建在磁盘上,数据存放在内存中,所以当MySQL启动着的时候,这个表是存在的,数据也是存在的,当MySQL重启后,数据消失,表结构还存在(临时表表结构及数据都在内存中)。

    内存表最大所需内存需要通过max_heap_table_size=1024M设定,临时表最大所需内存需要通过tmp_table_size = 1024M设定。当数据超过临时表的最大值设定时,自动转为基于磁盘的MyISAM表,存储在指定的tmpdir目录,此时因需要进行IO操作,性能会大大下降,而内存表不会,内存表满后,会提示数据满错误。

2 内存表特征及优缺点

    2.2 内存表优点

    

    2.3 内存表缺点

    2.3.1 内存表不能包含BLOB或者TEXT列;

ERROR 1163 (42000): The used table type doesn't support BLOB/TEXT columns
    2.3.2 

3 内存表基本操作

    3.1 内存表创建

CREATE TABLE mem_table(  id int(10),  num int(10)) ENGINE=MEMORY;

    3.2  

转载请注明出处:http://blog.csdn.net/jesseyoung/article/details/37931505


Statement:
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