Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5
Description
This was a rather surprising find while profiling.
mtr_t::mtr_t allocates memory through construction of one of its members
This allocations accounts for 0.68% of CPU time (constructor itself for 0.77% of CPU time), this happens to be the largest contributor to the "operator new" on oltp_update_index benchmark with bufferpool larger than size of the data ( without doublewrite)
Attachments
Issue Links
- causes
-
MDEV-22970 Possible corruption of page_compressed tables, or when scrubbing is enabled
-
- Closed
-
- is caused by
-
MDEV-8139 Fix scrubbing
-
- Closed
-
This might be due to the m_freed_ranges that
MDEV-8139added, or this is an older regression.In any case, we may want to introduce a separate object for read-only operations, and possibly we could avoid creating a mtr_t at all when an operation is only reading a small number of pages and could take care of releasing the page latches manually. For read-only operations, mtr_t::m_log and mtr_t::m_freed_ranges are totally unnecessary.
For 10.6, I have been thinking of replacing both mtr_t::m_log and mtr_t::m_memo with something like a std::unordered_map that maps buf_block_t* to log record snippets.