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

Reduce the amount of mem_heap_create() or malloc()

Details

    Description

      InnoDB is frequently allocating and deallocating memory during simple operations, such as INSERT or UPDATE. It should be more efficient to use a single mem_heap_t for the whole row operation, maybe row_prebuilt_t::heap. Maybe some dynamic allocations could be avoided altogether. Perhaps we could use one or two preallocated buffers for rec_get_offsets(), possibly in btr_cur_t or page_cur_t, and avoid repeated calls to rec_get_offsets().

      Attachments

        Issue Links

          Activity

            kevg Eugene Kosov (Inactive) added a comment - - edited

            Maximum possible offset fits into uint16_t, right? And maximum amount of offsets is less than 1024 (REC_MAX_N_FIELDS). So, what about making offsets array a stack variable? No mem_heap_t will be needed for records then.

            kevg Eugene Kosov (Inactive) added a comment - - edited Maximum possible offset fits into uint16_t , right? And maximum amount of offsets is less than 1024 ( REC_MAX_N_FIELDS ). So, what about making offsets array a stack variable? No mem_heap_t will be needed for records then.

            I think that MDEV-16232 would involve moving mtr_t and offsets to row_prebuilt_t, and thus we would end up having fewer dynamic allocation operations.

            marko Marko Mäkelä added a comment - I think that MDEV-16232 would involve moving mtr_t and offsets to row_prebuilt_t , and thus we would end up having fewer dynamic allocation operations.

            In MDEV-32050, the purging of committed transaction history was improved. Undo log records will be accessed directly in the buffer pool and not copied into a separate memory heap.

            Thanks to MDEV-30289 and MDEV-30400, most mini-transactions should not involve memory heap allocation related to mtr_t::m_memo, because the memory for tracking up to 16 latched pages will be preallocated in the typically stack-allocated mtr_t.

            MDEV-33559 removed some heap memory allocation related to some SPATIAL INDEX operations.

            marko Marko Mäkelä added a comment - In MDEV-32050 , the purging of committed transaction history was improved. Undo log records will be accessed directly in the buffer pool and not copied into a separate memory heap. Thanks to MDEV-30289 and MDEV-30400 , most mini-transactions should not involve memory heap allocation related to mtr_t::m_memo , because the memory for tracking up to 16 latched pages will be preallocated in the typically stack-allocated mtr_t . MDEV-33559 removed some heap memory allocation related to some SPATIAL INDEX operations.

            People

              Unassigned Unassigned
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.