Commit 732d2f32 authored by marko's avatar marko

branches/zip: dtuple_convert_big_rec(): Reduce the locally stored part

of externally stored columns to REC_1BYTE_OFFS_LIMIT (128) bytes.
TODO: only store BTR_EXTERN_FIELD_REF_SIZE (20) bytes with the record,
and store the entire column externally.  (Bug #22496)

dict_col_t::min_prefix: Remove.
parent 16a5b788
......@@ -551,8 +551,7 @@ dtuple_convert_big_rec(
for (i = dict_index_get_n_unique_in_tree(index);
i < dtuple_get_n_fields(entry); i++) {
ulint min_prefix;
ulint savings;
dfield = dtuple_get_nth_field(entry, i);
ifield = dict_index_get_nth_field(index, i);
......@@ -561,27 +560,16 @@ dtuple_convert_big_rec(
if (ifield->fixed_len
|| dfield->len == UNIV_SQL_NULL
|| dfield->len <= (BTR_EXTERN_FIELD_REF_SIZE
+ REC_1BYTE_OFFS_LIMIT + 1)) {
continue;
|| dfield->len <= REC_1BYTE_OFFS_LIMIT + 1) {
goto skip_field;
}
min_prefix = ifield->col->min_prefix;
/* Skip indexed columns */
if (min_prefix == ULINT_UNDEFINED) {
continue;
}
if (min_prefix < (REC_1BYTE_OFFS_LIMIT + 1
- BTR_EXTERN_FIELD_REF_SIZE)) {
min_prefix = (REC_1BYTE_OFFS_LIMIT + 1
- BTR_EXTERN_FIELD_REF_SIZE);
}
savings = dfield->len - (REC_1BYTE_OFFS_LIMIT + 1
- BTR_EXTERN_FIELD_REF_SIZE);
/* Check that there would be savings */
if (longest >= dfield->len - min_prefix) {
continue;
if (longest >= savings) {
goto skip_field;
}
/* Skip externally stored columns */
......@@ -591,15 +579,15 @@ dtuple_convert_big_rec(
for (j = 0; j < n_ext_vec; j++) {
if (ext_vec[j] == i) {
goto is_externally_stored;
goto skip_field;
}
}
}
longest_i = i;
longest = dfield->len - min_prefix;
longest = savings;
is_externally_stored:
skip_field:
continue;
}
......@@ -622,9 +610,8 @@ dtuple_convert_big_rec(
vector->fields[n_fields].field_no = longest_i;
vector->fields[n_fields].len
= dfield->len - ut_max(REC_1BYTE_OFFS_LIMIT + 1
- BTR_EXTERN_FIELD_REF_SIZE,
ifield->col->min_prefix);
= dfield->len - (REC_1BYTE_OFFS_LIMIT + 1
- BTR_EXTERN_FIELD_REF_SIZE);
vector->fields[n_fields].data
= mem_heap_alloc(heap, vector->fields[n_fields].len);
......@@ -643,6 +630,7 @@ dtuple_convert_big_rec(
+ dfield->len - BTR_EXTERN_FIELD_REF_SIZE,
0, BTR_EXTERN_FIELD_REF_SIZE);
n_fields++;
ut_ad(n_fields < dtuple_get_n_fields(entry));
}
vector->n_fields = n_fields;
......
......@@ -1869,11 +1869,6 @@ dict_index_build_internal_non_clust(
if (field->prefix_len == 0) {
indexed[field->col->ind] = TRUE;
field->col->min_prefix = ULINT_UNDEFINED;
} else if (field->col->min_prefix < field->prefix_len) {
field->col->min_prefix = field->prefix_len;
}
}
......
......@@ -206,7 +206,6 @@ dict_mem_table_add_col(
col->ind = table->n_def - 1;
col->ord_part = 0;
col->min_prefix = 0;
col->mtype = mtype;
col->prtype = prtype;
......
......@@ -159,10 +159,6 @@ struct dict_col_struct{
unsigned ord_part:1; /* nonzero if this column
appears in the ordering fields
of an index */
ulint min_prefix;/* the longest prefix index defined
on the column (in bytes), 0 if no index
defined, and ULINT_UNDEFINED if an index
is defined on the entire column */
};
#define DICT_MAX_INDEX_COL_LEN REC_MAX_INDEX_COL_LEN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment