MySQL 8.0.40
Source Code Documentation
|
The proper function call sequence of Page_load is as below: – Page_load::init – Page_load::insert – Page_load::finish – Page_load::compress(COMPRESSED table only) – Page_load::page_split(COMPRESSED table only) – Page_load::commit. More...
Classes | |
struct | Split_point |
Page split point descriptor. More... | |
Public Member Functions | |
Page_load (dict_index_t *index, trx_id_t trx_id, page_no_t page_no, size_t level, Flush_observer *observer) noexcept | |
Constructor. More... | |
~Page_load () noexcept | |
Destructor. More... | |
Private Types | |
using | Rec_offsets = ulint * |
Private Member Functions | |
dberr_t | init () noexcept |
Initialize members and allocate page if needed and start mtr. More... | |
dberr_t | insert (const dtuple_t *tuple, const big_rec_t *big_rec, size_t rec_size) noexcept |
Insert a tuple in the page. More... | |
void | finish () noexcept |
Mark end of insertion to the page. More... | |
void | commit () noexcept |
Commit mtr for a page. More... | |
void | rollback () noexcept |
Commit mtr for a page. More... | |
bool | compress () noexcept |
Compress if it is compressed table. More... | |
bool | need_ext (const dtuple_t *tuple, size_t rec_size) const noexcept |
Check whether the record needs to be stored externally. More... | |
dtuple_t * | get_node_ptr () noexcept |
Get node pointer. More... | |
void | split (Page_load &new_page_load) noexcept |
Split the page records between this and given bulk. More... | |
void | copy_all (const page_t *src_page) noexcept |
Copy all records from page. More... | |
void | set_next (page_no_t next_page_no) noexcept |
Set next page. More... | |
void | set_prev (page_no_t prev_page_no) noexcept |
Set previous page. More... | |
void | release () noexcept |
Release block by committing mtr. More... | |
void | latch () noexcept |
Start mtr and latch block. More... | |
bool | is_space_available (size_t rec_size) const noexcept |
Check if required space is available in the page for the rec to be inserted. More... | |
page_no_t | get_page_no () const noexcept |
Get page no. More... | |
size_t | get_level () const noexcept |
Get page level. More... | |
size_t | get_rec_no () const |
Get record no. More... | |
const page_t * | get_page () const noexcept |
Get page. More... | |
bool | is_table_compressed () const noexcept |
Check if table is compressed. More... | |
bool | is_index_locked () noexcept |
Check if index is X locked. More... | |
Split_point | get_split_rec () noexcept |
Get page split point. More... | |
void | copy_records (const rec_t *first_rec) noexcept |
Copy given and all following records. More... | |
void | split_trim (const Split_point &split_point) noexcept |
Remove all records after split rec including itself. More... | |
dberr_t | insert (const rec_t *rec, Rec_offsets offsets) noexcept |
Insert a record in the page, check for duplicates too. More... | |
dberr_t | store_ext (const big_rec_t *big_rec, Rec_offsets offsets) noexcept |
Store external record Since the record is not logged yet, so we don't log update to the record. More... | |
Private Member Functions inherited from ut::Non_copyable | |
Non_copyable (const Non_copyable &)=delete | |
Non_copyable & | operator= (const Non_copyable &)=delete |
Non_copyable ()=default | |
~Non_copyable ()=default | |
Private Attributes | |
mem_heap_t * | m_heap {} |
Memory heap for internal allocation. More... | |
dict_index_t * | m_index {} |
The index B-tree. More... | |
mtr_t * | m_mtr {} |
The min-transaction. More... | |
trx_id_t | m_trx_id {} |
The transaction id. More... | |
buf_block_t * | m_block {} |
The buffer block. More... | |
page_t * | m_page {} |
The page. More... | |
page_zip_des_t * | m_page_zip {} |
The page zip descriptor. More... | |
rec_t * | m_cur_rec {} |
The current rec, just before the next insert rec. More... | |
page_no_t | m_page_no {} |
The page no. More... | |
size_t | m_level {} |
The page level in B-tree. More... | |
const bool | m_is_comp {} |
Flag: is page in compact format. More... | |
byte * | m_heap_top {} |
The heap top in page for next insert. More... | |
size_t | m_rec_no {} |
User record no. More... | |
size_t | m_free_space {} |
The free space left in the page. More... | |
size_t | m_reserved_space {} |
The reserved space for fill factor. More... | |
size_t | m_padding_space {} |
The padding space for compressed page. More... | |
size_t | m_total_data {} |
Total data in the page. More... | |
uint64_t | m_modify_clock {} |
The modify clock value of the buffer block when the block is re-pinned. More... | |
Flush_observer * | m_flush_observer {} |
Flush observer. More... | |
rec_t * | m_last_slotted_rec {} |
Last record assigned to a slot. More... | |
size_t | m_slotted_rec_no {} |
Number of records assigned to slots. More... | |
bool | m_modified {} |
Page modified flag. More... | |
int32_t | m_n_blocks_buf_fixed {} |
Number of blocks which are buffer fixed but not pushed to mtr memo. More... | |
Friends | |
class | Btree_load |
The proper function call sequence of Page_load is as below: – Page_load::init – Page_load::insert – Page_load::finish – Page_load::compress(COMPRESSED table only) – Page_load::page_split(COMPRESSED table only) – Page_load::commit.
|
private |
|
inlinenoexcept |
Constructor.
[in] | index | B-tree index |
[in] | trx_id | Transaction id |
[in] | page_no | Page number |
[in] | level | Page level |
[in] | observer | Flush observer |
|
inlinenoexcept |
Destructor.
|
privatenoexcept |
Commit mtr for a page.
|
privatenoexcept |
Compress if it is compressed table.
|
privatenoexcept |
Copy all records from page.
[in] | src_page | Page with records to copy. |
|
privatenoexcept |
Copy given and all following records.
[in] | first_rec | First record to copy |
|
privatenoexcept |
Mark end of insertion to the page.
Scan records to set page dirs, and set page header members. The scan is incremental (slots and records which assignment could be "finalized" are not checked again. Check the m_slotted_rec_no usage, note it could be reset in some cases like during split. Note: we refer to page_copy_rec_list_end_to_created_page.
|
inlineprivatenoexcept |
Get page level.
|
privatenoexcept |
Get node pointer.
|
inlineprivatenoexcept |
Get page.
|
inlineprivatenoexcept |
Get page no.
|
inlineprivate |
Get record no.
|
privatenoexcept |
Get page split point.
We split a page in half when compression fails, and the split record and all following records should be copied to the new page.
|
privatenoexcept |
Initialize members and allocate page if needed and start mtr.
|
privatenoexcept |
Insert a tuple in the page.
[in] | tuple | Tuple to insert |
[in] | big_rec | External record |
[in] | rec_size | Record size |
|
privatenoexcept |
Insert a record in the page, check for duplicates too.
[in] | rec | Record |
[in] | offsets | Record offsets |
|
privatenoexcept |
Check if index is X locked.
|
inlineprivatenoexcept |
Check if required space is available in the page for the rec to be inserted.
We check fill factor & padding here.
[in] | rec_size | Required space |
|
inlineprivatenoexcept |
Check if table is compressed.
|
inlineprivatenoexcept |
Start mtr and latch block.
Start mtr and latch the block.
|
privatenoexcept |
Check whether the record needs to be stored externally.
|
inlineprivatenoexcept |
Release block by committing mtr.
|
privatenoexcept |
Commit mtr for a page.
|
privatenoexcept |
Set next page.
[in] | next_page_no | Next page no |
|
privatenoexcept |
Set previous page.
[in] | prev_page_no | Previous page no |
|
privatenoexcept |
Split the page records between this and given bulk.
new_page_load | The new bulk to store split records. |
|
privatenoexcept |
Remove all records after split rec including itself.
[in] | split_point | Split point descriptor |
|
privatenoexcept |
Store external record Since the record is not logged yet, so we don't log update to the record.
the blob data is logged first, then the record is logged in bulk mode.
[in] | big_rec | External record |
[in] | offsets | Record offsets |
|
friend |
|
private |
The buffer block.
|
private |
The current rec, just before the next insert rec.
|
private |
Flush observer.
|
private |
The free space left in the page.
|
private |
Memory heap for internal allocation.
|
private |
The heap top in page for next insert.
|
private |
The index B-tree.
|
private |
Flag: is page in compact format.
|
private |
Last record assigned to a slot.
|
private |
The page level in B-tree.
|
private |
Page modified flag.
|
private |
The modify clock value of the buffer block when the block is re-pinned.
|
private |
The min-transaction.
|
private |
Number of blocks which are buffer fixed but not pushed to mtr memo.
|
private |
The padding space for compressed page.
|
private |
The page.
|
private |
The page no.
|
private |
The page zip descriptor.
|
private |
User record no.
|
private |
The reserved space for fill factor.
|
private |
Number of records assigned to slots.
|
private |
Total data in the page.
|
private |
The transaction id.