The difference between Mysql memory table and temporary table

The memory table is a table placed in memory. The size of the memory used can be specified by max_heap_table_size in My.cnf, such as max_heap_table_size=1024M. Temporary tables are also stored in memory, and the maximum memory required for temporary tables needs to be set by tmp_table_size=1024M.

       When the data exceeds the maximum setting of the temporary table, it will be automatically converted to a disk table. At this time, due to the need for IO operations, the performance will be greatly reduced, but the memory table will not. When the memory table is full, a data full error will be displayed.

        Both temporary tables and in-memory tables can be created manually, but the more function of temporary tables is to organize data to improve performance after the system has created them, such as subqueries. Temporary tables cannot be shared among multiple connections.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326454879&siteId=291194637