MySQL  8.0.19
Source Code Documentation
page0types.h File Reference
#include "dict0types.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_HEADER
 
#define PAGE_N_DIR_SLOTS   0 /* number of slots in page directory */
 
#define PAGE_HEAP_TOP   2 /* pointer to record heap top */
 
#define PAGE_N_HEAP
 
#define PAGE_FREE   6 /* pointer to start of page free record list */
 
#define PAGE_GARBAGE   8 /* number of bytes in deleted records */
 
#define PAGE_LAST_INSERT
 
#define PAGE_DIRECTION   12 /* last insert direction: PAGE_LEFT, ... */
 
#define PAGE_N_DIRECTION
 
#define PAGE_N_RECS   16 /* number of user records on the page */
 
#define PAGE_MAX_TRX_ID
 
#define PAGE_HEADER_PRIV_END
 
#define PAGE_LEVEL
 
#define PAGE_INDEX_ID
 
#define PAGE_BTR_SEG_LEAF
 
#define PAGE_BTR_IBUF_FREE_LIST   PAGE_BTR_SEG_LEAF
 
#define PAGE_BTR_IBUF_FREE_LIST_NODE   PAGE_BTR_SEG_LEAF
 
#define PAGE_BTR_SEG_TOP   (36 + FSEG_HEADER_SIZE)
 
#define PAGE_DATA   (PAGE_HEADER + 36 + 2 * FSEG_HEADER_SIZE)
 
#define PAGE_OLD_INFIMUM   (PAGE_DATA + 1 + REC_N_OLD_EXTRA_BYTES)
 
#define PAGE_OLD_SUPREMUM   (PAGE_DATA + 2 + 2 * REC_N_OLD_EXTRA_BYTES + 8)
 
#define PAGE_OLD_SUPREMUM_END   (PAGE_OLD_SUPREMUM + 9)
 
#define PAGE_NEW_INFIMUM   (PAGE_DATA + REC_N_NEW_EXTRA_BYTES)
 
#define PAGE_NEW_SUPREMUM   (PAGE_DATA + 2 * REC_N_NEW_EXTRA_BYTES + 8)
 
#define PAGE_NEW_SUPREMUM_END   (PAGE_NEW_SUPREMUM + 8)
 
#define PAGE_LEFT   1
 
#define PAGE_RIGHT   2
 
#define PAGE_SAME_REC   3
 
#define PAGE_SAME_PAGE   4
 
#define PAGE_NO_DIRECTION   5
 
#define page_t   ib_page_t
 Eliminates a name collision on HP-UX. More...
 
#define PAGE_ZIP_SSIZE_BITS   3
 Number of bits needed for representing different compressed page sizes. More...
 
#define PAGE_ZIP_SSIZE_MAX   (UNIV_ZIP_SIZE_SHIFT_MAX - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
 Maximum compressed page shift size. 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  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
}
 

Functions

void page_zip_rec_set_deleted (page_zip_des_t *page_zip, const byte *rec, ulint 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 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...
 
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...
 

Detailed Description

Index page routines

Created 2/2/1994 Heikki Tuuri

Macro Definition Documentation

◆ PAGE_BTR_IBUF_FREE_LIST

#define PAGE_BTR_IBUF_FREE_LIST   PAGE_BTR_SEG_LEAF

◆ PAGE_BTR_IBUF_FREE_LIST_NODE

#define PAGE_BTR_IBUF_FREE_LIST_NODE   PAGE_BTR_SEG_LEAF

◆ PAGE_BTR_SEG_LEAF

#define PAGE_BTR_SEG_LEAF
Value:
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 */

◆ PAGE_BTR_SEG_TOP

#define PAGE_BTR_SEG_TOP   (36 + FSEG_HEADER_SIZE)

◆ PAGE_DATA

#define PAGE_DATA   (PAGE_HEADER + 36 + 2 * FSEG_HEADER_SIZE)

◆ PAGE_DIRECTION

#define PAGE_DIRECTION   12 /* last insert direction: PAGE_LEFT, ... */

◆ PAGE_FREE

#define PAGE_FREE   6 /* pointer to start of page free record list */

◆ PAGE_GARBAGE

#define PAGE_GARBAGE   8 /* number of bytes in deleted records */

◆ PAGE_HEADER

#define PAGE_HEADER
Value:
FSEG_PAGE_DATA /* index page header starts at this \
offset */

◆ PAGE_HEADER_PRIV_END

#define PAGE_HEADER_PRIV_END
Value:
26 /* end of private data structure of the page \
header which are set in a page create */

◆ PAGE_HEAP_TOP

#define PAGE_HEAP_TOP   2 /* pointer to record heap top */

◆ PAGE_INDEX_ID

#define PAGE_INDEX_ID
Value:
28 /* index id where the page belongs. \
This field should not be written to after \
page creation. */

◆ PAGE_LAST_INSERT

#define PAGE_LAST_INSERT
Value:
10 /* pointer to the last inserted record, or \
NULL if this info has been reset by a delete, \
for example */

◆ PAGE_LEFT

#define PAGE_LEFT   1

◆ PAGE_LEVEL

#define PAGE_LEVEL
Value:
26 /* 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. */

◆ PAGE_MAX_TRX_ID

#define PAGE_MAX_TRX_ID
Value:
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 */

◆ PAGE_N_DIR_SLOTS

#define PAGE_N_DIR_SLOTS   0 /* number of slots in page directory */

◆ PAGE_N_DIRECTION

#define PAGE_N_DIRECTION
Value:
14 /* number of consecutive inserts to the same \
direction */

◆ PAGE_N_HEAP

#define PAGE_N_HEAP
Value:
4 /* number of records in the heap, \
bit 15=flag: new-style compact page format */

◆ PAGE_N_RECS

#define PAGE_N_RECS   16 /* number of user records on the page */

◆ PAGE_NEW_INFIMUM

#define PAGE_NEW_INFIMUM   (PAGE_DATA + REC_N_NEW_EXTRA_BYTES)

◆ PAGE_NEW_SUPREMUM

#define PAGE_NEW_SUPREMUM   (PAGE_DATA + 2 * REC_N_NEW_EXTRA_BYTES + 8)

◆ PAGE_NEW_SUPREMUM_END

#define PAGE_NEW_SUPREMUM_END   (PAGE_NEW_SUPREMUM + 8)

◆ PAGE_NO_DIRECTION

#define PAGE_NO_DIRECTION   5

◆ PAGE_OLD_INFIMUM

#define PAGE_OLD_INFIMUM   (PAGE_DATA + 1 + REC_N_OLD_EXTRA_BYTES)

◆ PAGE_OLD_SUPREMUM

#define PAGE_OLD_SUPREMUM   (PAGE_DATA + 2 + 2 * REC_N_OLD_EXTRA_BYTES + 8)

◆ PAGE_OLD_SUPREMUM_END

#define PAGE_OLD_SUPREMUM_END   (PAGE_OLD_SUPREMUM + 9)

◆ PAGE_RIGHT

#define PAGE_RIGHT   2

◆ PAGE_SAME_PAGE

#define PAGE_SAME_PAGE   4

◆ PAGE_SAME_REC

#define PAGE_SAME_REC   3

◆ page_t

#define page_t   ib_page_t

Eliminates a name collision on HP-UX.

◆ PAGE_ZIP_SSIZE_BITS

#define PAGE_ZIP_SSIZE_BITS   3

Number of bits needed for representing different compressed page sizes.

◆ PAGE_ZIP_SSIZE_MAX

#define PAGE_ZIP_SSIZE_MAX   (UNIV_ZIP_SIZE_SHIFT_MAX - UNIV_ZIP_SIZE_SHIFT_MIN + 1)

Maximum compressed page shift size.

Typedef Documentation

◆ page_header_t

◆ page_t

typedef byte page_t

Type of the index page.

◆ page_zip_stat_per_index_t

Compression statistics types.

◆ page_zip_t

typedef byte page_zip_t

Compressed index page.

Enumeration Type Documentation

◆ page_cur_mode_t

Enumerator
PAGE_CUR_UNSUPP 
PAGE_CUR_G 
PAGE_CUR_GE 
PAGE_CUR_L 
PAGE_CUR_LE 
PAGE_CUR_CONTAIN 
PAGE_CUR_INTERSECT 
PAGE_CUR_WITHIN 
PAGE_CUR_DISJOINT 
PAGE_CUR_MBR_EQUAL 
PAGE_CUR_RTREE_INSERT 
PAGE_CUR_RTREE_LOCATE 
PAGE_CUR_RTREE_GET_FATHER 

Function Documentation

◆ page_zip_dir_add_slot()

void page_zip_dir_add_slot ( page_zip_des_t page_zip,
bool  is_clustered 
)

Add a slot to the dense page directory.

in: nonzero for clustered index, zero for others

Parameters
page_zipin/out: compressed page

◆ page_zip_dir_delete()

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.

Parameters
[in,out]page_zipcompressed page
[in]recdeleted record
[in]indexindex of rec
[in]offsetsrec_get_offsets(rec)
[in]freeprevious start of the free list

◆ page_zip_rec_set_deleted()

void page_zip_rec_set_deleted ( page_zip_des_t page_zip,
const byte rec,
ulint  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_rec_set_owned()

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: the owned flag (nonzero=TRUE)

The n_owned field must already have been written on the uncompressed page.

Variable Documentation

◆ PAGE_HEAP_NO_INFIMUM

constexpr ulint PAGE_HEAP_NO_INFIMUM = 0
constexpr

Page infimum.

◆ PAGE_HEAP_NO_SUPREMUM

constexpr ulint PAGE_HEAP_NO_SUPREMUM = 1
constexpr

Page supremum.

◆ PAGE_HEAP_NO_USER_LOW

constexpr ulint PAGE_HEAP_NO_USER_LOW = 2
constexpr

First user record in creation (insertion) order, not necessarily collation order; this record may have been deleted.

◆ page_zip_stat

Statistics on compression, indexed by page_zip_des_t::ssize - 1.

◆ page_zip_stat_per_index

page_zip_stat_per_index_t page_zip_stat_per_index

Statistics on compression, indexed by dict_index_t::id.

Statistics on compression, indexed by dict_index_t::id.

FSEG_PAGE_DATA
#define FSEG_PAGE_DATA
On a page of any file segment, data may be put starting from this offset.
Definition: fsp0types.h:74