Details
-
Task
-
Status: In Review (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
When server starts it sets my_default_record_cache_size to the value of global variable read_buffer_size.
The user cannot change my_default_record_cache_size after server restart.
The default value for read_buffer_size is 131072.
When creating a heap/memory table, the value of my_default_record_cache is used as the
maximum block size used when allocation data for records.
This causes performance issues in the case where the record length is big (> 1000 bytes) and the my_default_record_cache is small.
To fix this, two things should be done:
- Update my_default_record_cache_size if the user changes global.read_buffer_size.
- Use the session value of read_buffer_size when creating heap tables
For some test that I have been running, which is using record length=633, the speed of the query doubled when doing
set @@read_buffer_size=1024*1024;
This enabled the heap table to put 165 rows in a block instead of just 21 and do 7 times less malloc calls.