MySQL 8.4.2
Source Code Documentation
|
Insert buffer. More...
Classes | |
struct | ibuf_t |
Insert buffer struct. More... | |
Functions | |
static void | ibuf_mtr_start (mtr_t *mtr) |
Starts an insert buffer mini-transaction. More... | |
static void | ibuf_mtr_commit (mtr_t *mtr) |
Commits an insert buffer mini-transaction. More... | |
void | ibuf_set_free_bits_func (buf_block_t *block, ulint val) |
Sets the free bit of the page in the ibuf bitmap. More... | |
static void | ibuf_set_free_bits (buf_block_t *b, ulint v, ulint) |
static bool | 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. More... | |
static bool | ibuf_inside (const mtr_t *mtr) |
Returns true if the current OS thread is performing an insert buffer routine. More... | |
static bool | ibuf_bitmap_page (const page_id_t &page_id, const page_size_t &page_size) |
Checks if a page address is an ibuf bitmap page (level 3 page) address. More... | |
static ulint | ibuf_index_page_calc_free_bits (ulint page_size, ulint max_ins_size) |
Translates the free space on a page to a value in the ibuf bitmap. More... | |
static ulint | ibuf_index_page_calc_free_from_bits (const page_size_t &page_size, ulint bits) |
Translates the ibuf free bits to the free space on a page in bytes. More... | |
static ulint | ibuf_index_page_calc_free_zip (const buf_block_t *block) |
Translates the free space on a compressed page to a value in the ibuf bitmap. More... | |
static ulint | ibuf_index_page_calc_free (const buf_block_t *block) |
Translates the free space on a page to a value in the ibuf bitmap. More... | |
static 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. More... | |
Variables | |
constexpr uint32_t | 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. More... | |
Insert buffer.
Created 7/19/1997 Heikki Tuuri
|
inlinestatic |
Checks if a page address is an ibuf bitmap page (level 3 page) address.
[in] | page_id | page id |
[in] | page_size | page size |
|
inlinestatic |
Translates the free space on a page to a value in the ibuf bitmap.
block | in: buffer block |
Translates the free space on a page to a value in the ibuf bitmap.
[in] | page_size | page size in bytes |
[in] | max_ins_size | maximum insert size after reorganize for the page |
|
inlinestatic |
Translates the ibuf free bits to the free space on a page in bytes.
[in] | page_size | page_size |
[in] | bits | value for ibuf bitmap bits |
|
inlinestatic |
Translates the free space on a compressed page to a value in the ibuf bitmap.
block | in: buffer block |
|
inlinestatic |
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 |
|
inlinestatic |
Commits an insert buffer mini-transaction.
mtr | in/out: mini-transaction |
|
inlinestatic |
Starts an insert buffer mini-transaction.
mtr | out: mini-transaction |
|
inlinestatic |
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
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.
block | in: index page of a non-clustered index; free bit is reset if page level is 0 |
val | in: value to set: < 4 |
|
inlinestatic |
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 |
|
inlinestatic |
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 |
|
constexpr |
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.