• Thirunarayanan Balathandayuthapani's avatar
    MDEV-33542 Inplace algorithm occupies more disk space compared to copy algorithm · c3a6248b
    Thirunarayanan Balathandayuthapani authored
    Problem:
    =======
    - In case of large file size, InnoDB eagerly adds the new extent
    even though there are many existing unused pages of the segment.
    Reason is that in case of larger file size, threshold
    (1/8 of reserved pages) for adding new extent has been
    reached frequently.
    
    Solution:
    =========
    - Try to utilise the unused pages in the segment before adding
    the new extent in the file segment.
    
    need_for_new_extent(): In case of larger file size, try to use
    the 4 * FSP_EXTENT_SIZE as threshold to allocate the new extent.
    
    fseg_alloc_free_page_low(): Rewrote the function to allocate
    the page in the following order.
    1) Try to get the page from existing segment extent.
    2) Check whether the segment needs new extent
    (need_for_new_extent()) and allocate the new extent,
    find the page.
    3) Take individual page from the unused page from
    segment or tablespace.
    4) Allocate a new extent and take first page from it.
    
    Removed FSEG_FILLFACTOR, FSEG_FRAG_LIMIT variable.
    c3a6248b
row0import.cc 132 KB