Skip to content
Permalink
Browse files

WL#6871 cleanup:

Remove support for byte-level prefix granularity in searches.

There were 2 users of this information: the adaptive hash index, and
prefix searches (cmp_dtuple_is_prefix_of_rec(), called for match_mode
== ROW_SEL_EXACT_PREFIX).

The byte-level granularity was only available for VARBINARY columns,
and before rb#2350 Bug#16723431 REMOVE SRV_LATIN1_ORDERING, for the
default collation latin1_swedish_ci. Prefix searches should never
supply a partial-field prefix, due to an assertion in
row_sel_convert_mysql_key_to_innobase().

The adaptive hash index is unlikely to benefit much from the
byte-level granularity either. (No performance penalty was observed
when testing rb#2350, and the keys did include latin1_swedish_ci.)

btr_cur_t: Remove up_bytes, low_bytes.
btr_search_t: Remove n_bytes.
buf_block_t: Remove n_bytes, curr_n_bytes.

dtuple_fold(), rec_fold(): Remove n_bytes.

ut_pair_min(), ut_pair_cmp(): Remove.

page_cur_search_with_match(), page_cur_try_search_shortcut():
Remove iup_matched_bytes, ilow_matched_bytes.

cmp_dtuple_rec_with_match_low(), cmp_dtuple_rec_with_match():
Remove matched_bytes.

PageCur::searchShortcut(): Remove up_match_bytes, low_match_bytes.
  • Loading branch information...
Marko Mäkelä
Marko Mäkelä committed May 23, 2013
1 parent a201661 commit 42499d9394bf103a27d63cd38b0c3c6bd738a7c7
@@ -389,9 +389,7 @@ btr_cur_search_to_nth_level(
ulint height;
ulint page_no;
ulint up_match;
ulint up_bytes;
ulint low_match;
ulint low_bytes;
ulint savepoint;
ulint rw_latch;
ulint page_mode;
@@ -418,9 +416,7 @@ btr_cur_search_to_nth_level(
ut_ad(index->page != FIL_NULL);

UNIV_MEM_INVALID(&cursor->up_match, sizeof cursor->up_match);
UNIV_MEM_INVALID(&cursor->up_bytes, sizeof cursor->up_bytes);
UNIV_MEM_INVALID(&cursor->low_match, sizeof cursor->low_match);
UNIV_MEM_INVALID(&cursor->low_bytes, sizeof cursor->low_bytes);
#ifdef UNIV_DEBUG
cursor->up_match = ULINT_UNDEFINED;
cursor->low_match = ULINT_UNDEFINED;
@@ -556,9 +552,7 @@ btr_cur_search_to_nth_level(
page_no = dict_index_get_page(index);

up_match = 0;
up_bytes = 0;
low_match = 0;
low_bytes = 0;

height = ULINT_UNDEFINED;

@@ -737,8 +731,8 @@ btr_cur_search_to_nth_level(
}

page_cur_search_with_match(
block, index, tuple, page_mode, &up_match, &up_bytes,
&low_match, &low_bytes, page_cursor);
block, index, tuple, page_mode, &up_match,
&low_match, page_cursor);

if (estimate) {
btr_cur_add_path_info(cursor, height, root_height);
@@ -785,9 +779,7 @@ btr_cur_search_to_nth_level(
btr_assert_not_corrupted(child_block, index);
} else {
cursor->low_match = low_match;
cursor->low_bytes = low_bytes;
cursor->up_match = up_match;
cursor->up_bytes = up_bytes;

#ifdef BTR_CUR_ADAPT
/* We do a dirty read of btr_search_enabled here. We

0 comments on commit 42499d9

Please sign in to comment.
You can’t perform that action at this time.