InnoDB Plugin
1.0
|
Data Structures | |
struct | ibuf_t |
Macros | |
#define | IBUF_PAGE_SIZE_PER_FREE_SPACE 32 |
#define | ibuf_set_free_bits(b, v, max) ibuf_set_free_bits_func(b,v) |
Functions | |
UNIV_INLINE void | ibuf_mtr_start (mtr_t *mtr) |
UNIV_INLINE void | ibuf_mtr_commit (mtr_t *mtr) |
UNIV_INTERN void | ibuf_set_free_bits_func (buf_block_t *block, ulint val) |
UNIV_INLINE ibool | ibuf_should_try (dict_index_t *index, ulint ignore_sec_unique) |
UNIV_INLINE ibool | ibuf_inside (const mtr_t *mtr) |
UNIV_INLINE ibool | ibuf_bitmap_page (ulint zip_size, ulint page_no) |
UNIV_INLINE ulint | ibuf_index_page_calc_free_bits (ulint zip_size, ulint max_ins_size) |
UNIV_INLINE ulint | ibuf_index_page_calc_free_from_bits (ulint zip_size, ulint bits) |
UNIV_INLINE ulint | ibuf_index_page_calc_free_zip (ulint zip_size, const buf_block_t *block) |
UNIV_INLINE ulint | ibuf_index_page_calc_free (ulint zip_size, const buf_block_t *block) |
UNIV_INLINE void | ibuf_update_free_bits_if_full (buf_block_t *block, ulint max_ins_size, ulint increase) |
Insert buffer
Created 7/19/1997 Heikki Tuuri
#define IBUF_PAGE_SIZE_PER_FREE_SPACE 32 |
An index page must contain at least UNIV_PAGE_SIZE /
IBUF_PAGE_SIZE_PER_FREE_SPACE bytes of free space for ibuf to try to buffer inserts to this page. If there is this much of free space, the corresponding bits are set in the ibuf bitmap.
UNIV_INLINE ibool ibuf_bitmap_page | ( | ulint | zip_size, |
ulint | page_no | ||
) |
Checks if a page address is an ibuf bitmap page address.
zip_size | in: compressed page size in bytes; 0 for uncompressed pages |
page_no | in: page number |
UNIV_INLINE ulint ibuf_index_page_calc_free | ( | ulint | zip_size, |
const buf_block_t * | block | ||
) |
Translates the free space on a page to a value in the ibuf bitmap.
zip_size | in: compressed page size in bytes; 0 for uncompressed pages |
block | in: buffer block |
UNIV_INLINE ulint ibuf_index_page_calc_free_bits | ( | ulint | zip_size, |
ulint | max_ins_size | ||
) |
Translates the free space on a page to a value in the ibuf bitmap.
zip_size | in: compressed page size in bytes; 0 for uncompressed pages |
max_ins_size | in: maximum insert size after reorganize for the page |
UNIV_INLINE ulint ibuf_index_page_calc_free_from_bits | ( | ulint | zip_size, |
ulint | bits | ||
) |
Translates the ibuf free bits to the free space on a page in bytes.
zip_size | in: compressed page size in bytes; 0 for uncompressed pages |
bits | in: value for ibuf bitmap bits |
UNIV_INLINE ulint ibuf_index_page_calc_free_zip | ( | ulint | zip_size, |
const buf_block_t * | block | ||
) |
Translates the free space on a compressed page to a value in the ibuf bitmap.
zip_size | in: compressed page size in bytes |
block | in: buffer block |
Returns TRUE if the current OS thread is performing an insert buffer routine.
For instance, a read-ahead of non-ibuf pages is forbidden by threads that are executing an insert buffer routine.
mtr | in: mini-transaction |
UNIV_INLINE void ibuf_mtr_commit | ( | mtr_t * | mtr | ) |
Commits an insert buffer mini-transaction.
mtr | in/out: mini-transaction |
UNIV_INLINE void ibuf_mtr_start | ( | mtr_t * | mtr | ) |
Starts an insert buffer mini-transaction.
mtr | out: mini-transaction |
UNIV_INTERN void ibuf_set_free_bits_func | ( | buf_block_t * | block, |
ulint | val | ||
) |
Sets the free bit of the page in the ibuf bitmap. This is done in a separate mini-transaction, hence this operation does not restrict further work to only ibuf bitmap operations, which would result if the latch to the bitmap page were kept. in: value to set: < 4
block | in: index page of a non-clustered index; free bit is reset if page level is 0 |
UNIV_INLINE ibool ibuf_should_try | ( | dict_index_t * | index, |
ulint | ignore_sec_unique | ||
) |
A basic partial test if an insert to the insert buffer could be possible and recommended.
index | in: index where to insert |
ignore_sec_unique | in: if != 0, we should ignore UNIQUE constraint on a secondary index when we decide |
UNIV_INLINE void ibuf_update_free_bits_if_full | ( | buf_block_t * | block, |
ulint | max_ins_size, | ||
ulint | increase | ||
) |
Updates the free bits of an uncompressed page in the ibuf bitmap if there is not enough free on the page any more. This is done in a separate mini-transaction, hence this operation does not restrict further work to only ibuf bitmap operations, which would result if the latch to the bitmap page were kept. NOTE: The free bits in the insert buffer bitmap must never exceed the free space on a page. It is unsafe to increment the bits in a separately committed mini-transaction, because in crash recovery, the free bits could momentarily be set too high. It is only safe to use this function for decrementing the free bits. Should more free space become available, we must not update the free bits here, because that would break crash recovery.
block | in: index page to which we have added new records; the free bits are updated if the index is non-clustered and non-unique and the page level is 0, and the page becomes fuller |
max_ins_size | in: value of maximum insert size with reorganize before the latest operation performed to the page |
increase | in: upper limit for the additional space used in the latest operation, if known, or ULINT_UNDEFINED |