Comments - MEMORY Storage Engine

2 years, 3 months ago Oli Sennhauser

Some findings: The memory for a MEMORY table is only allocated when used. So an empty MEMORY table does nearly not use any space.

Example: 2 MEMORY tables with max_heap_table_size = 64M and fully filled up until: ERROR 1114 (HY000): The table 'test_mem2' is full

select event_name, CURRENT_NUMBER_OF_BYTES_USED 
  from performance_schema.memory_summary_global_by_event_name 
  where event_name like 'memory/memory/%';
+-------------------------+------------------------------+
| event_name              | CURRENT_NUMBER_OF_BYTES_USED |
+-------------------------+------------------------------+
| memory/memory/HP_SHARE  |                         4776 |
| memory/memory/HP_INFO   |                         4000 |
| memory/memory/HP_PTRS   |                    134636384 |
| memory/memory/HP_KEYDEF |                            0 |
+-------------------------+------------------------------+
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.