InnoDB Plugin  1.0
Macros | Functions
page0zip.ic File Reference
#include "page0zip.h"
#include "mtr0log.h"
#include "page0page.h"
Include dependency graph for page0zip.ic:
This graph shows which files directly or indirectly include this file:

Macros

#define PAGE_ZIP_START   PAGE_NEW_SUPREMUM_END
#define PAGE_ZIP_DIR_SLOT_SIZE   2
#define PAGE_ZIP_DIR_SLOT_MASK   0x3fff
#define PAGE_ZIP_DIR_SLOT_OWNED   0x4000
#define PAGE_ZIP_DIR_SLOT_DEL   0x8000

Functions

UNIV_INLINE ulint page_zip_get_size (const page_zip_des_t *page_zip)
UNIV_INLINE void page_zip_set_size (page_zip_des_t *page_zip, ulint size)
UNIV_INLINE ibool page_zip_rec_needs_ext (ulint rec_size, ulint comp, ulint n_fields, ulint zip_size)
UNIV_INLINE ibool page_zip_simple_validate (const page_zip_des_t *page_zip)
UNIV_INLINE ibool page_zip_get_trailer_len (const page_zip_des_t *page_zip, ibool is_clust)
UNIV_INLINE lint page_zip_max_ins_size (const page_zip_des_t *page_zip, ibool is_clust)
UNIV_INLINE ibool page_zip_available (const page_zip_des_t *page_zip, ibool is_clust, ulint length, ulint create)
UNIV_INLINE void page_zip_des_init (page_zip_des_t *page_zip)
UNIV_INTERN void page_zip_write_header_log (const byte *data, ulint length, mtr_t *mtr)
UNIV_INLINE void page_zip_write_header (page_zip_des_t *page_zip, const byte *str, ulint length, mtr_t *mtr)
UNIV_INLINE void page_zip_compress_write_log_no_data (ulint level, const page_t *page, dict_index_t *index, mtr_t *mtr)
UNIV_INLINE 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)
UNIV_INLINE void page_zip_reset_stat_per_index ()

Detailed Description

Compressed page interface

Created June 2005 by Marko Makela

Macro Definition Documentation

#define PAGE_ZIP_DIR_SLOT_DEL   0x8000

'deleted' flag

#define PAGE_ZIP_DIR_SLOT_MASK   0x3fff

Mask of record offsets

#define PAGE_ZIP_DIR_SLOT_OWNED   0x4000

'owned' flag

#define PAGE_ZIP_DIR_SLOT_SIZE   2

Size of an compressed page directory entry

#define PAGE_ZIP_START   PAGE_NEW_SUPREMUM_END

Start offset of the area that will be compressed

Function Documentation

UNIV_INLINE ibool page_zip_available ( const page_zip_des_t page_zip,
ibool  is_clust,
ulint  length,
ulint  create 
)

Determine if enough space is available in the modification log.

Returns
TRUE if enough space is available
Parameters
page_zipin: compressed page
is_clustin: TRUE if clustered index
lengthin: combined size of the record
createin: nonzero=add the record to the heap
UNIV_INLINE 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.

Parameters
levelin: compression level
pagein: page that is compressed
indexin: index
mtrin: mtr
UNIV_INLINE void page_zip_des_init ( page_zip_des_t page_zip)

Initialize a compressed page descriptor.

Parameters
page_zipin/out: compressed page descriptor
UNIV_INLINE ulint page_zip_get_size ( const page_zip_des_t page_zip)

Determine the size of a compressed page in bytes.

Returns
size in bytes
Parameters
page_zipin: compressed page
UNIV_INLINE ibool page_zip_get_trailer_len ( const page_zip_des_t page_zip,
ibool  is_clust 
)

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
UNIV_INLINE lint page_zip_max_ins_size ( const page_zip_des_t page_zip,
ibool  is_clust 
)

Determine how big record can be inserted without recompressing the page.

Returns
a positive number indicating the maximum size of a record whose insertion is guaranteed to succeed, or zero or negative
Parameters
page_zipin: compressed page
is_clustin: TRUE if clustered index
UNIV_INLINE 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 
)

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
UNIV_INLINE ibool page_zip_rec_needs_ext ( ulint  rec_size,
ulint  comp,
ulint  n_fields,
ulint  zip_size 
)

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

Returns
FALSE if the entire record can be stored locally on the page
Parameters
rec_sizein: length of the record in bytes
compin: nonzero=compact format
n_fieldsin: number of fields in the record; ignored if zip_size == 0
zip_sizein: compressed page size in bytes, or 0
UNIV_INLINE void page_zip_reset_stat_per_index ( )

Reset the counters used for filling INFORMATION_SCHEMA.innodb_cmp_per_index.

UNIV_INLINE void page_zip_set_size ( page_zip_des_t page_zip,
ulint  size 
)

Set the size of a compressed page in bytes.

Parameters
page_zipin/out: compressed page
sizein: size in bytes
UNIV_INLINE ibool page_zip_simple_validate ( const page_zip_des_t page_zip)

Validate a compressed page descriptor.

Returns
TRUE if ok
Parameters
page_zipin: compressed page descriptor
UNIV_INLINE 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. The data must already have been written to the uncompressed page. However, the data portion of the uncompressed page may differ from the compressed page when a record is being inserted in page_cur_insert_rec_zip().

Parameters
page_zipin/out: compressed page
strin: address on the uncompressed page
lengthin: length of the data
mtrin: mini-transaction, or NULL
UNIV_INTERN 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