1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Reducing memory when using information schema

The background is that one user had a lot of views and using some complex
queries on information schema temporary memory of more than 2G was used.

- Added new element 'total_alloc' to MEM_ROOT for easier debugging.
- Added MAX_MEMORY_USED to information_schema.processlist.
- Added new status variable "Memory_used_initial" that shows how much MariaDB
  uses at startup. This gives the base value for "Memory_used".
- Reuse memory continuously for information schema queries instead of
  only freeing memory at query end.

Other things
- Removed some not needed set_notnull() calls for not null columns.
This commit is contained in:
Monty
2017-11-01 20:28:36 +02:00
parent 2ec7b87053
commit 9ec19b9b41
15 changed files with 274 additions and 219 deletions

View File

@ -815,6 +815,7 @@ typedef struct system_status_var
double cpu_time, busy_time;
/* Don't initialize */
/* Memory used for thread local storage */
int64 max_local_memory_used;
volatile int64 local_memory_used;
/* Memory allocated for global usage */
volatile int64 global_memory_used;
@ -4513,7 +4514,6 @@ public:
See also sp_head::merge_lex().
*/
bool restore_from_local_lex_to_old_lex(LEX *oldlex);
};
inline void add_to_active_threads(THD *thd)