~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/mem0mem.ic

Merge Revision revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6674 from MySQL InnoDB

Original revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6674

Original Authors: inaam
Original commit message:
branches/zip bug# 49535

This is a backport of r4924.
mem_heap_get_size() scans all allocated blocks to calculate the total
size of the heap. This patch introduces a new, total_size, field in
mem_block_info_struct. This field is valid only for base block 
(i.e.: the first block allocated for the heap) and is set to
ULINT_UNDEFINED in other blocks.
This considerably improves the performance of redo scan during recovery.

rb://108 issue#216

Approved by: Heikki

------------------------------------------------------------------------

Show diffs side-by-side

added added

removed removed

Lines of Context:
581
581
/*==============*/
582
582
        mem_heap_t*     heap)   /*!< in: heap */
583
583
{
584
 
        mem_block_t*    block;
585
584
        ulint           size    = 0;
586
585
 
587
586
        ut_ad(mem_heap_check(heap));
588
587
 
589
 
        block = heap;
590
 
 
591
 
        while (block != NULL) {
592
 
 
593
 
                size += mem_block_get_len(block);
594
 
                block = UT_LIST_GET_NEXT(list, block);
595
 
        }
 
588
        size = heap->total_size;
 
589
 
596
590
#ifndef UNIV_HOTBACKUP
597
591
        if (heap->free_block) {
598
592
                size += UNIV_PAGE_SIZE;