Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35469

Heap tables are calling mallocs to often

    XMLWordPrintable

Details

    • Task
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6
    • 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.

      Attachments

        Activity

          People

            monty Michael Widenius
            monty Michael Widenius
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.