Bug #108763 | InnoDB Inefficient Memory Allocation for Data Dictionary | ||
---|---|---|---|
Submitted: | 13 Oct 2022 12:11 | Modified: | 17 Oct 2022 13:29 |
Reporter: | Vasanth S | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Dictionary | Severity: | S2 (Serious) |
Version: | 5.7.35, 8.0.30 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | datadictionary, Memory, memoryallocation, tabledefinitioncache |
[13 Oct 2022 12:11]
Vasanth S
[13 Oct 2022 13:33]
MySQL Verification Team
Hi Mr. Vasanth, Thank you for your bug report. However , this is not a bug. Cacheing data in the version 5.7 and in the version 8.0 will not be changed. Furthermore, there are no further improvements planned for 5.7, but only 8.0. Unlike 5.7, 8.0 has a proper data dictionary, with a totally different algorithms for the memory allocation. Memory allocation for data dictionary in 8.0 is optimised for speed and not for size, since gigabytes and terabytes of RAM are now easily available. If you have any feature requests or performance enhancements for 8.0, then, please, file a separate bug report. Not a bug.
[17 Oct 2022 6:58]
Vasanth S
Greetings team, Thank you for your immediate response. However, "Unlike 5.7, 8.0 has a proper data dictionary, with a totally different algorithms for the memory allocation" On checking the MySQL 8.0.30, the order of memory allocation in dict_mem_index_create(), dict_mem_fill_index_struct() methods remains the same. "Memory allocation for data dictionary in 8.0 is optimised for speed and not for size, since gigabytes and terabytes of RAM are now easily available" We totally understand. However, On changing the order in which the memory is allocated, the size of the data dictionary can be reduced hugely. Our proposal is to allocate the known smaller memories initially itself so we can make use of the available RAM efficiently. Thank you for being kind enough to let us share our suggestions here. Please note that bringing up this small change will be beneficial for all MySQL users.
[17 Oct 2022 12:33]
MySQL Verification Team
Hi Mr. S, Please, read our responses carefully. Memory allocation in 8.0 is optimised for speed and not size. That is what we wrote. Hence, if we allocate smaller amount of memory at the start, then all our users would experience a significant slowdown during the running of the server. That is because additional memory would need to be allocated during the runtime, which would slow down all operations. Not a bug.
[17 Oct 2022 13:29]
Vasanth S
Hi Verification Team, Please read our request carefully. Our request was not to lessen the size of the memory block created but to change the order of metadata allocation in those blocks, particularly for Dictionary memory (@0mem.c). "That is because additional memory would need to be allocated during the runtime, which would slow down all operations." Even in your current flow, Memory is being allocated during run time only. A fresh heap is created only when a table is read. Only after all the metadata is loaded, the heap->total_size is added to the dict_sys->size variable. I don't see any issues that will arise because of changing the order in which this memory is allocated. Awaiting your response.
[17 Oct 2022 13:57]
MySQL Verification Team
Hi, Reducing memory allocation by small amount is not an objective for us. We do not see how that would improve performance. You are discussing very small memory allocations, which are insignificant for the computers on which our server is running. However, if you can show how can this improve performance significantly, then this could be analysed as a performance enhancement request.