summaryrefslogtreecommitdiff
path: root/storage/innobase/include/rem0cmp.h
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-11-04 22:30:12 +0300
committerEugene Kosov <claprix@yandex.ru>2019-12-13 00:26:50 +0700
commitf0aa073f2bf3d8d85b3d028df89cdb4cdfc4002d (patch)
tree63a3e0b64a64741d2b2b0ba47b02e9d92dc1f516 /storage/innobase/include/rem0cmp.h
parentbeec9c0e19284a0e50d3629f4cb2486007b0333b (diff)
downloadmariadb-git-f0aa073f2bf3d8d85b3d028df89cdb4cdfc4002d.tar.gz
MDEV-20950 Reduce size of record offsetsbb-10.2-MDEV-20950-stack-offsets
offset_t: this is a type which represents one record offset. It's unsigned short int. a lot of functions: replace ulint with offset_t btr_pcur_restore_position_func(), page_validate(), row_ins_scan_sec_index_for_duplicate(), row_upd_clust_rec_by_insert_inherit_func(), row_vers_impl_x_locked_low(), trx_undo_prev_version_build(): allocate record offsets on the stack instead of waiting for rec_get_offsets() to allocate it from mem_heap_t. So, reducing memory allocations. RECORD_OFFSET, INDEX_OFFSET: now it's less convenient to store pointers in offset_t* array. One pointer occupies now several offset_t. And those constant are start indexes into array to places where to store pointer values REC_OFFS_HEADER_SIZE: adjusted for the new reality REC_OFFS_NORMAL_SIZE: increase size from 100 to 300 which means less heap allocations. And sizeof(offset_t[REC_OFFS_NORMAL_SIZE]) now is 600 bytes which is smaller than previous 800 bytes. REC_OFFS_SEC_INDEX_SIZE: adjusted for the new reality rem0rec.h, rem0rec.ic, rem0rec.cc: various arguments, return values and local variables types were changed to fix numerous integer conversions issues. enum field_type_t: offset types concept was introduces which replaces old offset flags stuff. Like in earlier version, 2 upper bits are used to store offset type. And this enum represents those types. REC_OFFS_SQL_NULL, REC_OFFS_MASK: removed get_type(), set_type(), get_value(), combine(): these are convenience functions to work with offsets and it's types rec_offs_base()[0]: still uses an old scheme with flags REC_OFFS_COMPACT and REC_OFFS_EXTERNAL rec_offs_base()[i]: these have type offset_t now. Two upper bits contains type.
Diffstat (limited to 'storage/innobase/include/rem0cmp.h')
-rw-r--r--storage/innobase/include/rem0cmp.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/storage/innobase/include/rem0cmp.h b/storage/innobase/include/rem0cmp.h
index 9582b0df393..0877c7b5b6a 100644
--- a/storage/innobase/include/rem0cmp.h
+++ b/storage/innobase/include/rem0cmp.h
@@ -89,7 +89,7 @@ cmp_dtuple_rec_with_gis(
/*====================*/
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
page_cur_mode_t mode)
MY_ATTRIBUTE((nonnull));
@@ -105,7 +105,7 @@ int
cmp_dtuple_rec_with_gis_internal(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets);
+ const offset_t* offsets);
/** Compare a data tuple to a physical record.
@param[in] dtuple data tuple
@@ -121,7 +121,7 @@ int
cmp_dtuple_rec_with_match_low(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets,
+ const offset_t* offsets,
ulint n_cmp,
ulint* matched_fields)
MY_ATTRIBUTE((nonnull));
@@ -145,7 +145,7 @@ cmp_dtuple_rec_with_match_bytes(
const dtuple_t* dtuple,
const rec_t* rec,
const dict_index_t* index,
- const ulint* offsets,
+ const offset_t* offsets,
ulint* matched_fields,
ulint* matched_bytes)
MY_ATTRIBUTE((warn_unused_result));
@@ -162,7 +162,7 @@ int
cmp_dtuple_rec(
const dtuple_t* dtuple,
const rec_t* rec,
- const ulint* offsets);
+ const offset_t* offsets);
/**************************************************************//**
Checks if a dtuple is a prefix of a record. The last field in dtuple
is allowed to be a prefix of the corresponding field in the record.
@@ -172,7 +172,7 @@ cmp_dtuple_is_prefix_of_rec(
/*========================*/
const dtuple_t* dtuple, /*!< in: data tuple */
const rec_t* rec, /*!< in: physical record */
- const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
+ const offset_t* offsets);/*!< in: array returned by rec_get_offsets() */
/** Compare two physical records that contain the same number of columns,
none of which are stored externally.
@retval positive if rec1 (including non-ordering columns) is greater than rec2
@@ -183,8 +183,8 @@ cmp_rec_rec_simple(
/*===============*/
const rec_t* rec1, /*!< in: physical record */
const rec_t* rec2, /*!< in: physical record */
- const ulint* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
- const ulint* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
+ const offset_t* offsets1,/*!< in: rec_get_offsets(rec1, ...) */
+ const offset_t* offsets2,/*!< in: rec_get_offsets(rec2, ...) */
const dict_index_t* index, /*!< in: data dictionary index */
struct TABLE* table) /*!< in: MySQL table, for reporting
duplicate key value if applicable,
@@ -209,8 +209,8 @@ int
cmp_rec_rec_with_match(
const rec_t* rec1,
const rec_t* rec2,
- const ulint* offsets1,
- const ulint* offsets2,
+ const offset_t* offsets1,
+ const offset_t* offsets2,
const dict_index_t* index,
bool nulls_unequal,
ulint* matched_fields);
@@ -231,8 +231,8 @@ int
cmp_rec_rec(
const rec_t* rec1,
const rec_t* rec2,
- const ulint* offsets1,
- const ulint* offsets2,
+ const offset_t* offsets1,
+ const offset_t* offsets2,
const dict_index_t* index,
ulint* matched_fields = NULL);