Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Through conversations with a customer, adding variables to make temp tables in memory and memory table size more measurable. These variables should be a maximum of a global (or session) total. ie memory for tmp or heap tables in total can never exceed this value.
2 variables should be added:
max_total_tmp_table_size
max_total_heap_table_size
If set, queries wanting to insert to or create in memory tables would wait on memory availability or they could just go to disk as on disk temp tables. This could be controlled with another variable, such as max_total_heap_table_wait=0|1
For example, if max_total_tmp_table_size = 1G, and 9 connections do 1 query each which creates 9 100M tables. Query 10 comes through and creates 101M of temp table, it cannot complete until one of the previous 9 queries deallocates memory, ie deletes rows or drops tables.
While this makes more sense as a global variable, it could also be per session, in that this session cannot exceed the session or global total at all (whichever is lower).
Defaults should be 0 (unlimited).
Attachments
Issue Links
- relates to
-
MDEV-9954 Prevent MEMORY tables from consuming all RAM
- Confirmed