MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
buf_pool_t Struct Reference

The buffer pool structure. More...

#include <buf0buf.h>

Collaboration diagram for buf_pool_t:

Public Attributes

General fields
ib_mutex_t mutex
ib_mutex_t zip_mutex
ulint instance_no
ulint old_pool_size
ulint curr_pool_size
ulint LRU_old_ratio
ulint n_chunks
buf_chunk_t * chunks
ulint curr_size
hash_table_tpage_hash
hash_table_tzip_hash
ulint n_pend_reads
ulint n_pend_unzip
time_t last_printout_time
buf_buddy_stat_t buddy_stat [BUF_BUDDY_SIZES_MAX+1]
buf_pool_stat_t stat
buf_pool_stat_t old_stat

Page flushing algorithm fields

ib_mutex_t flush_list_mutex
const buf_page_tflush_list_hp
ibool init_flush [BUF_FLUSH_N_TYPES]
ulint n_flush [BUF_FLUSH_N_TYPES]
os_event_t no_flush [BUF_FLUSH_N_TYPES]
ib_rbt_tflush_rbt
ulint freed_page_clock
ibool try_LRU_scan
 UT_LIST_BASE_NODE_T (buf_page_t) flush_list

LRU replacement algorithm fields

buf_page_tLRU_old
ulint LRU_old_len
 UT_LIST_BASE_NODE_T (buf_page_t) free
 UT_LIST_BASE_NODE_T (buf_page_t) LRU
 UT_LIST_BASE_NODE_T (buf_block_t) unzip_LRU

Buddy allocator fields

The buddy allocator is used for allocating compressed page frames and buf_page_t descriptors of blocks that exist in the buffer pool only in compressed form.

buf_page_twatch
 UT_LIST_BASE_NODE_T (buf_buddy_free_t) zip_free[BUF_BUDDY_SIZES_MAX]

Detailed Description

The buffer pool structure.

NOTE! The definition appears here only for other modules of this directory (buf) to see it. Do not use from outside!

Definition at line 1793 of file buf0buf.h.

Member Function Documentation

buf_pool_t::UT_LIST_BASE_NODE_T ( buf_page_t  )

base node of the modified block list

buf_pool_t::UT_LIST_BASE_NODE_T ( buf_page_t  )

base node of the free block list

buf_pool_t::UT_LIST_BASE_NODE_T ( buf_page_t  )

base node of the LRU list

buf_pool_t::UT_LIST_BASE_NODE_T ( buf_block_t  )

base node of the unzip_LRU list

buf_pool_t::UT_LIST_BASE_NODE_T ( buf_buddy_free_t  )

buddy free lists

Member Data Documentation

buf_buddy_stat_t buf_pool_t::buddy_stat[BUF_BUDDY_SIZES_MAX+1]

Statistics of buddy system, indexed by block size

Definition at line 1842 of file buf0buf.h.

buf_chunk_t* buf_pool_t::chunks

buffer pool chunks

Definition at line 1817 of file buf0buf.h.

ulint buf_pool_t::curr_pool_size

Current pool size in bytes

Definition at line 1806 of file buf0buf.h.

ulint buf_pool_t::curr_size

current pool size in pages

Definition at line 1818 of file buf0buf.h.

const buf_page_t* buf_pool_t::flush_list_hp

"hazard pointer" used during scan of flush_list while doing flush list batch. Protected by flush_list_mutex

Definition at line 1861 of file buf0buf.h.

ib_mutex_t buf_pool_t::flush_list_mutex

mutex protecting the flush list access. This mutex protects flush_list, flush_rbt and bpage::list pointers when the bpage is on flush_list. It also protects writes to bpage::oldest_modification and flush_list_hp

Definition at line 1853 of file buf0buf.h.

ib_rbt_t* buf_pool_t::flush_rbt

a red-black tree is used exclusively during recovery to speed up insertions in the flush_list. This tree contains blocks in order of oldest_modification LSN and is kept in sync with the flush_list. Each member of the tree MUST also be on the flush_list. This tree is relevant only in recovery and is set to NULL once the recovery is over. Protected by flush_list_mutex

Definition at line 1878 of file buf0buf.h.

ulint buf_pool_t::freed_page_clock

a sequence number used to count the number of buffer blocks removed from the end of the LRU list; NOTE that this counter may wrap around at 4 billion! A thread is allowed to read this for heuristic purposes without holding any mutex or latch

Definition at line 1892 of file buf0buf.h.

ibool buf_pool_t::init_flush[BUF_FLUSH_N_TYPES]

this is TRUE when a flush of the given type is being initialized

Definition at line 1869 of file buf0buf.h.

ulint buf_pool_t::instance_no

Array index of this buffer pool instance

Definition at line 1803 of file buf0buf.h.

time_t buf_pool_t::last_printout_time

when buf_print_io was last time called

Definition at line 1839 of file buf0buf.h.

buf_page_t* buf_pool_t::LRU_old

pointer to the about LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV oldest blocks in the LRU list; NULL if LRU length less than BUF_LRU_OLD_MIN_LEN; NOTE: when LRU_old != NULL, its length should always equal LRU_old_len

Definition at line 1921 of file buf0buf.h.

ulint buf_pool_t::LRU_old_len

length of the LRU list from the block to which LRU_old points onward, including that block; see buf0lru.cc for the restrictions on this value; 0 if LRU_old == NULL; NOTE: LRU_old_len must be adjusted whenever LRU_old shrinks or grows!

Definition at line 1928 of file buf0buf.h.

ulint buf_pool_t::LRU_old_ratio

Reserve this much of the buffer pool for "old" blocks

Definition at line 1807 of file buf0buf.h.

ib_mutex_t buf_pool_t::mutex

Buffer pool mutex of this instance

Definition at line 1797 of file buf0buf.h.

ulint buf_pool_t::n_chunks

number of buffer pool chunks

Definition at line 1816 of file buf0buf.h.

ulint buf_pool_t::n_flush[BUF_FLUSH_N_TYPES]

this is the number of pending writes in the given flush type

Definition at line 1872 of file buf0buf.h.

ulint buf_pool_t::n_pend_reads

number of pending read operations

Definition at line 1834 of file buf0buf.h.

ulint buf_pool_t::n_pend_unzip

number of pending decompressions

Definition at line 1836 of file buf0buf.h.

os_event_t buf_pool_t::no_flush[BUF_FLUSH_N_TYPES]

this is in the set state when there is no flush batch of the given type running

Definition at line 1875 of file buf0buf.h.

ulint buf_pool_t::old_pool_size

Old pool size in bytes

Definition at line 1805 of file buf0buf.h.

buf_pool_stat_t buf_pool_t::old_stat

old statistics

Definition at line 1845 of file buf0buf.h.

hash_table_t* buf_pool_t::page_hash

hash table of buf_page_t or buf_block_t file pages, buf_page_in_file() == TRUE, indexed by (space_id, offset). page_hash is protected by an array of mutexes. Changes in page_hash are protected by buf_pool->mutex and the relevant page_hash mutex. Lookups can happen while holding the buf_pool->mutex or the relevant page_hash mutex.

Definition at line 1819 of file buf0buf.h.

buf_pool_stat_t buf_pool_t::stat

current statistics

Definition at line 1844 of file buf0buf.h.

ibool buf_pool_t::try_LRU_scan

Set to FALSE when an LRU scan for free block fails. This flag is used to avoid repeated scans of LRU list when we know that there is no free block available in the scan depth for eviction. Set to TRUE whenever we flush a batch from the buffer pool. Protected by the buf_pool->mutex

Definition at line 1901 of file buf0buf.h.

buf_page_t* buf_pool_t::watch

Sentinel records for buffer pool watches. Protected by buf_pool->mutex.

Definition at line 1954 of file buf0buf.h.

hash_table_t* buf_pool_t::zip_hash

hash table of buf_block_t blocks whose frames are allocated to the zip buddy system, indexed by block->frame

Definition at line 1830 of file buf0buf.h.

ib_mutex_t buf_pool_t::zip_mutex

Zip mutex of this buffer pool instance, protects compressed only pages (of type buf_page_t, not buf_block_t

Definition at line 1799 of file buf0buf.h.


The documentation for this struct was generated from the following file: