MySQL 8.4.2
Source Code Documentation
|
Index page routines. More...
#include "dict0types.h"
#include "fsp0types.h"
#include "mtr0types.h"
#include "univ.i"
#include "ut0new.h"
#include <map>
Go to the source code of this file.
Classes | |
struct | page_zip_des_t |
Compressed page descriptor. More... | |
struct | page_zip_stat_t |
Compression statistics for a given page size. More... | |
Macros | |
#define | PAGE_OLD_INFIMUM (PAGE_DATA + 1 + REC_N_OLD_EXTRA_BYTES) |
offset of the page infimum record on an old-style page More... | |
#define | PAGE_OLD_SUPREMUM (PAGE_DATA + 2 + 2 * REC_N_OLD_EXTRA_BYTES + 8) |
offset of the page supremum record on an old-style page More... | |
#define | PAGE_OLD_SUPREMUM_END (PAGE_OLD_SUPREMUM + 9) |
offset of the page supremum record end on an old-style page More... | |
#define | PAGE_NEW_INFIMUM (PAGE_DATA + REC_N_NEW_EXTRA_BYTES) |
offset of the page infimum record on a new-style compact page More... | |
#define | PAGE_NEW_SUPREMUM (PAGE_DATA + 2 * REC_N_NEW_EXTRA_BYTES + 8) |
offset of the page supremum record on a new-style compact page More... | |
#define | PAGE_NEW_SUPREMUM_END (PAGE_NEW_SUPREMUM + 8) |
offset of the page supremum record end on a new-style compact page More... | |
#define | page_t ib_page_t |
Eliminates a name collision on HP-UX. More... | |
Typedefs | |
typedef byte | page_header_t |
typedef byte | page_t |
Type of the index page. More... | |
typedef byte | page_zip_t |
Compressed index page. More... | |
typedef std::map< index_id_t, page_zip_stat_t, std::less< index_id_t >, ut::allocator< std::pair< const index_id_t, page_zip_stat_t > > > | page_zip_stat_per_index_t |
Compression statistics types. More... | |
Enumerations | |
enum | cursor_direction_t : uint8_t { PAGE_LEFT = 1 , PAGE_RIGHT = 2 , PAGE_SAME_REC = 3 , PAGE_SAME_PAGE = 4 , PAGE_NO_DIRECTION = 5 } |
enum | page_cur_mode_t { PAGE_CUR_UNSUPP = 0 , PAGE_CUR_G = 1 , PAGE_CUR_GE = 2 , PAGE_CUR_L = 3 , PAGE_CUR_LE = 4 , PAGE_CUR_CONTAIN = 7 , PAGE_CUR_INTERSECT = 8 , PAGE_CUR_WITHIN = 9 , PAGE_CUR_DISJOINT = 10 , PAGE_CUR_MBR_EQUAL = 11 , PAGE_CUR_RTREE_INSERT = 12 , PAGE_CUR_RTREE_LOCATE = 13 , PAGE_CUR_RTREE_GET_FATHER = 14 , PAGE_CUR_NN = 15 } |
Functions | |
void | page_zip_rec_set_deleted (page_zip_des_t *page_zip, const byte *rec, bool flag) |
Write the "deleted" flag of a record on a compressed page. More... | |
void | page_zip_rec_set_owned (page_zip_des_t *page_zip, const byte *rec, ulint flag) |
Write the "owned" flag of a record on a compressed page. More... | |
void | page_zip_dir_delete (page_zip_des_t *page_zip, byte *rec, dict_index_t *index, const ulint *offsets, const byte *free) |
Shift the dense page directory when a record is deleted. More... | |
void | page_zip_dir_add_slot (page_zip_des_t *page_zip, bool is_clustered) |
Add a slot to the dense page directory. More... | |
Variables | |
constexpr uint32_t | PAGE_HEADER = FSEG_PAGE_DATA |
index page header starts at this offset More... | |
constexpr uint32_t | PAGE_N_DIR_SLOTS = 0 |
number of slots in page directory More... | |
constexpr uint32_t | PAGE_HEAP_TOP = 2 |
pointer to record heap top More... | |
constexpr uint32_t | PAGE_N_HEAP = 4 |
number of records in the heap, bit 15=flag: new-style compact page format More... | |
constexpr uint32_t | PAGE_FREE = 6 |
pointer to start of page free record list More... | |
constexpr uint32_t | PAGE_GARBAGE = 8 |
number of bytes in deleted records More... | |
constexpr uint32_t | PAGE_LAST_INSERT = 10 |
pointer to the last inserted record, or NULL if this info has been reset by a delete, for example More... | |
constexpr uint32_t | PAGE_DIRECTION = 12 |
last insert direction: PAGE_LEFT, ... More... | |
constexpr uint32_t | PAGE_N_DIRECTION = 14 |
number of consecutive inserts to the same direction More... | |
constexpr uint32_t | PAGE_N_RECS = 16 |
number of user records on the page More... | |
constexpr uint32_t | PAGE_MAX_TRX_ID = 18 |
highest id of a trx which may have modified a record on the page; trx_id_t; defined only in secondary indexes and in the insert buffer tree More... | |
constexpr uint32_t | PAGE_HEADER_PRIV_END = 26 |
end of private data structure of the page header which are set in a page create More... | |
constexpr uint32_t | PAGE_LEVEL = 26 |
level of the node in an index tree; the leaf level is the level 0. More... | |
constexpr uint32_t | PAGE_INDEX_ID = 28 |
index id where the page belongs. More... | |
constexpr uint32_t | PAGE_BTR_SEG_LEAF = 36 |
file segment header for the leaf pages in a B-tree: defined only on the root page of a B-tree, but not in the root of an ibuf tree More... | |
constexpr uint32_t | PAGE_BTR_IBUF_FREE_LIST = PAGE_BTR_SEG_LEAF |
constexpr uint32_t | PAGE_BTR_IBUF_FREE_LIST_NODE = PAGE_BTR_SEG_LEAF |
constexpr uint32_t | PAGE_BTR_SEG_TOP = 36 + FSEG_HEADER_SIZE |
constexpr uint32_t | PAGE_DATA = PAGE_HEADER + 36 + 2 * FSEG_HEADER_SIZE |
start of data on the page More... | |
constexpr ulint | PAGE_HEAP_NO_INFIMUM = 0 |
Page infimum. More... | |
constexpr ulint | PAGE_HEAP_NO_SUPREMUM = 1 |
Page supremum. More... | |
constexpr ulint | PAGE_HEAP_NO_USER_LOW = 2 |
First user record in creation (insertion) order, not necessarily collation order; this record may have been deleted. More... | |
constexpr uint8_t | PAGE_ZIP_SSIZE_BITS = 3 |
Number of bits needed for representing different compressed page sizes. More... | |
constexpr uint32_t | PAGE_ZIP_SSIZE_MAX |
Maximum compressed page shift size. More... | |
page_zip_stat_t | page_zip_stat [PAGE_ZIP_SSIZE_MAX] |
Statistics on compression, indexed by page_zip_des_t::ssize - 1. More... | |
page_zip_stat_per_index_t | page_zip_stat_per_index |
Statistics on compression, indexed by dict_index_t::id. More... | |
Index page routines.
Created 2/2/1994 Heikki Tuuri
#define PAGE_NEW_INFIMUM (PAGE_DATA + REC_N_NEW_EXTRA_BYTES) |
offset of the page infimum record on a new-style compact page
#define PAGE_NEW_SUPREMUM (PAGE_DATA + 2 * REC_N_NEW_EXTRA_BYTES + 8) |
offset of the page supremum record on a new-style compact page
#define PAGE_NEW_SUPREMUM_END (PAGE_NEW_SUPREMUM + 8) |
offset of the page supremum record end on a new-style compact page
#define PAGE_OLD_INFIMUM (PAGE_DATA + 1 + REC_N_OLD_EXTRA_BYTES) |
offset of the page infimum record on an old-style page
#define PAGE_OLD_SUPREMUM (PAGE_DATA + 2 + 2 * REC_N_OLD_EXTRA_BYTES + 8) |
offset of the page supremum record on an old-style page
#define PAGE_OLD_SUPREMUM_END (PAGE_OLD_SUPREMUM + 9) |
offset of the page supremum record end on an old-style page
#define page_t ib_page_t |
Eliminates a name collision on HP-UX.
typedef byte page_header_t |
typedef std::map<index_id_t, page_zip_stat_t, std::less<index_id_t>, ut::allocator<std::pair<const index_id_t, page_zip_stat_t> > > page_zip_stat_per_index_t |
Compression statistics types.
typedef byte page_zip_t |
Compressed index page.
enum cursor_direction_t : uint8_t |
enum page_cur_mode_t |
void page_zip_dir_add_slot | ( | page_zip_des_t * | page_zip, |
bool | is_clustered | ||
) |
Add a slot to the dense page directory.
[in,out] | page_zip | Compressed page |
[in] | is_clustered | Nonzero for clustered index, zero for others |
void page_zip_dir_delete | ( | page_zip_des_t * | page_zip, |
byte * | rec, | ||
dict_index_t * | index, | ||
const ulint * | offsets, | ||
const byte * | free | ||
) |
Shift the dense page directory when a record is deleted.
[in,out] | page_zip | compressed page |
[in] | rec | deleted record |
[in] | index | index of rec |
[in] | offsets | rec_get_offsets(rec) |
[in] | free | previous start of the free list |
void page_zip_rec_set_deleted | ( | page_zip_des_t * | page_zip, |
const byte * | rec, | ||
bool | flag | ||
) |
Write the "deleted" flag of a record on a compressed page.
The flag must already have been written on the uncompressed page. in: the deleted flag (nonzero=true)
The flag must already have been written on the uncompressed page.
page_zip | in/out: compressed page |
rec | in: record on the uncompressed page |
flag | in: the deleted flag (nonzero=true) |
void page_zip_rec_set_owned | ( | page_zip_des_t * | page_zip, |
const byte * | rec, | ||
ulint | flag | ||
) |
Write the "owned" flag of a record on a compressed page.
The n_owned field must already have been written on the uncompressed page.
[in,out] | page_zip | Compressed page |
[in] | rec | Record on the uncompressed page |
[in] | flag | The owned flag (nonzero=true) |
|
constexpr |
|
constexpr |
|
constexpr |
file segment header for the leaf pages in a B-tree: defined only on the root page of a B-tree, but not in the root of an ibuf tree
|
constexpr |
|
constexpr |
start of data on the page
|
constexpr |
last insert direction: PAGE_LEFT, ...
|
constexpr |
pointer to start of page free record list
|
constexpr |
number of bytes in deleted records
|
constexpr |
index page header starts at this offset
|
constexpr |
end of private data structure of the page header which are set in a page create
|
constexpr |
Page infimum.
|
constexpr |
Page supremum.
|
constexpr |
First user record in creation (insertion) order, not necessarily collation order; this record may have been deleted.
|
constexpr |
pointer to record heap top
|
constexpr |
index id where the page belongs.
This field should not be written to after page creation.
|
constexpr |
pointer to the last inserted record, or NULL if this info has been reset by a delete, for example
|
constexpr |
level of the node in an index tree; the leaf level is the level 0.
This field should not be written to after page creation.
|
constexpr |
highest id of a trx which may have modified a record on the page; trx_id_t; defined only in secondary indexes and in the insert buffer tree
|
constexpr |
number of slots in page directory
|
constexpr |
number of consecutive inserts to the same direction
|
constexpr |
number of records in the heap, bit 15=flag: new-style compact page format
|
constexpr |
number of user records on the page
|
constexpr |
Number of bits needed for representing different compressed page sizes.
|
constexpr |
Maximum compressed page shift size.
|
extern |
Statistics on compression, indexed by page_zip_des_t::ssize - 1.
|
extern |
Statistics on compression, indexed by dict_index_t::id.
Statistics on compression, indexed by dict_index_t::id.