MySQL 8.0.31
Source Code Documentation
page0zip.ic File Reference

Compressed page interface. More...

#include "mtr0log.h"
#include "page0page.h"
#include "page0zip.h"
#include "srv0srv.h"

Functions

static void page_zip_set_size (page_zip_des_t *page_zip, ulint size)
 Set the size of a compressed page in bytes. More...
 
static bool page_zip_rec_needs_ext (ulint rec_size, ulint comp, ulint n_fields, const page_size_t &page_size)
 Determine if a record is so big that it needs to be stored externally. More...
 
static ulint page_zip_get_trailer_len (const page_zip_des_t *page_zip, bool is_clust)
 Determine if the length of the page trailer. More...
 
static lint page_zip_max_ins_size (const page_zip_des_t *page_zip, bool is_clust)
 
static bool page_zip_available (const page_zip_des_t *page_zip, bool is_clust, ulint length, ulint create)
 
static void page_zip_des_init (page_zip_des_t *page_zip)
 Initialize a compressed page descriptor. More...
 
void page_zip_write_header_log (const byte *data, ulint length, mtr_t *mtr)
 Write a log record of writing to the uncompressed header portion of a page. More...
 
static void page_zip_write_header (page_zip_des_t *page_zip, const byte *str, ulint length, mtr_t *mtr)
 Write data to the uncompressed header portion of a page. More...
 
static void page_zip_compress_write_log_no_data (ulint level, const page_t *page, dict_index_t *index, mtr_t *mtr)
 Write a log record of compressing an index page without the data on the page. More...
 
static bytepage_zip_parse_compress_no_data (byte *ptr, byte *end_ptr, page_t *page, page_zip_des_t *page_zip, dict_index_t *index)
 Parses a log record of compressing an index page without the data. More...
 
static void page_zip_reset_stat_per_index ()
 Reset the counters used for filling INFORMATION_SCHEMA.innodb_cmp_per_index. More...
 
static bytepage_zip_dir_find_low (byte *slot, byte *end, ulint offset)
 Find the slot of the given record in the dense page directory. More...
 
static ulint page_zip_dir_user_size (const page_zip_des_t *page_zip)
 Gets the size of the compressed page trailer (the dense page directory), only including user records (excluding the free list). More...
 
static bytepage_zip_dir_find_free (page_zip_des_t *page_zip, ulint offset)
 Find the slot of the given free record in the dense page directory. More...
 
static ulint page_zip_dir_start_offs (const page_zip_des_t *page_zip, ulint n_dense)
 Gets an offset to the compressed page trailer (the dense page directory), including deleted records (the free list). More...
 

Detailed Description

Compressed page interface.

Created June 2005 by Marko Makela

Function Documentation

◆ page_zip_available()

static bool page_zip_available ( const page_zip_des_t page_zip,
bool  is_clust,
ulint  length,
ulint  create 
)
inlinestatic

◆ page_zip_compress_write_log_no_data()

static void page_zip_compress_write_log_no_data ( ulint  level,
const page_t page,
dict_index_t index,
mtr_t mtr 
)
inlinestatic

Write a log record of compressing an index page without the data on the page.

Parameters
levelin: compression level
pagein: page that is compressed
indexin: index
mtrin: mtr

◆ page_zip_des_init()

static void page_zip_des_init ( page_zip_des_t page_zip)
inlinestatic

Initialize a compressed page descriptor.

Parameters
page_zipin/out: compressed page descriptor

◆ page_zip_dir_find_free()

static byte * page_zip_dir_find_free ( page_zip_des_t page_zip,
ulint  offset 
)
inlinestatic

Find the slot of the given free record in the dense page directory.

Returns
dense directory slot, or NULL if record not found
Parameters
page_zipin: compressed page
offsetin: offset of user record

◆ page_zip_dir_find_low()

static byte * page_zip_dir_find_low ( byte slot,
byte end,
ulint  offset 
)
inlinestatic

Find the slot of the given record in the dense page directory.

Returns
dense directory slot, or NULL if record not found
Parameters
slotin: start of records
endin: end of records
offsetin: offset of user record

◆ page_zip_dir_start_offs()

static ulint page_zip_dir_start_offs ( const page_zip_des_t page_zip,
ulint  n_dense 
)
inlinestatic

Gets an offset to the compressed page trailer (the dense page directory), including deleted records (the free list).

Returns
offset of the dense page directory
Parameters
page_zipin: compressed page
n_densein: directory size

◆ page_zip_dir_user_size()

static ulint page_zip_dir_user_size ( const page_zip_des_t page_zip)
inlinestatic

Gets the size of the compressed page trailer (the dense page directory), only including user records (excluding the free list).

Returns
length of dense page directory comprising existing records, in bytes
Parameters
page_zipin: compressed page

◆ page_zip_get_trailer_len()

static ulint page_zip_get_trailer_len ( const page_zip_des_t page_zip,
bool  is_clust 
)
inlinestatic

Determine if the length of the page trailer.

Returns
length of the page trailer, in bytes, not including the terminating zero byte of the modification log
Parameters
page_zipin: compressed page
is_clustin: true if clustered index

◆ page_zip_max_ins_size()

static lint page_zip_max_ins_size ( const page_zip_des_t page_zip,
bool  is_clust 
)
inlinestatic

◆ page_zip_parse_compress_no_data()

static byte * page_zip_parse_compress_no_data ( byte ptr,
byte end_ptr,
page_t page,
page_zip_des_t page_zip,
dict_index_t index 
)
inlinestatic

Parses a log record of compressing an index page without the data.

Returns
end of log record or NULL
Parameters
ptrin: buffer
end_ptrin: buffer end
pagein: uncompressed page
page_zipout: compressed page
indexin: index

◆ page_zip_rec_needs_ext()

static bool page_zip_rec_needs_ext ( ulint  rec_size,
ulint  comp,
ulint  n_fields,
const page_size_t page_size 
)
inlinestatic

Determine if a record is so big that it needs to be stored externally.

Parameters
[in]rec_sizelength of the record in bytes
[in]compnonzero=compact format
[in]n_fieldsnumber of fields in the record; ignored if tablespace is not compressed
[in]page_sizepage size
Returns
false if the entire record can be stored locally on the page

◆ page_zip_reset_stat_per_index()

static void page_zip_reset_stat_per_index ( )
inlinestatic

Reset the counters used for filling INFORMATION_SCHEMA.innodb_cmp_per_index.

◆ page_zip_set_size()

static void page_zip_set_size ( page_zip_des_t page_zip,
ulint  size 
)
inlinestatic

Set the size of a compressed page in bytes.

Parameters
page_zipin/out: compressed page
sizein: size in bytes

◆ page_zip_write_header()

static void page_zip_write_header ( page_zip_des_t page_zip,
const byte str,
ulint  length,
mtr_t mtr 
)
inlinestatic

Write data to the uncompressed header portion of a page.

The data must already have been written to the uncompressed page.

Parameters
[in,out]page_zipCompressed page
[in]strAddress on the uncompressed page
[in]lengthLength of the data
[in]mtrMini-transaction, or NULL

◆ page_zip_write_header_log()

void page_zip_write_header_log ( const byte data,
ulint  length,
mtr_t mtr 
)

Write a log record of writing to the uncompressed header portion of a page.

in: mini-transaction

Parameters
datain: data on the uncompressed page
lengthin: length of the data
mtrin: mini-transaction