Commit d7f9dffd authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

dict0dict.c:

  Add some UNIV_LIKELY and UNIV_UNLIKELY hints.
  dict_tree_copy_rec_order_prefix(): Add a UNIV_PREFETCH_R hint on rec.
parent 7284c72d
......@@ -1443,7 +1443,7 @@ dict_index_add_to_cache(
/* Increment the ord_part counts in columns which are ordering */
if (index->type & DICT_UNIVERSAL) {
if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) {
n_ord = new_index->n_fields;
} else {
n_ord = dict_index_get_n_unique(new_index);
......@@ -1472,7 +1472,7 @@ dict_index_add_to_cache(
new_index->tree = tree;
}
if (!(new_index->type & DICT_UNIVERSAL)) {
if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) {
new_index->stat_n_diff_key_vals =
mem_heap_alloc(new_index->heap,
......@@ -1673,7 +1673,7 @@ dict_index_copy_types(
dtype_t* type;
ulint i;
if (index->type & DICT_UNIVERSAL) {
if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) {
dtuple_set_types_binary(tuple, n_fields);
return;
......@@ -1769,7 +1769,7 @@ dict_index_build_internal_clust(
dict_index_copy(new_index, index, 0, index->n_fields);
}
if (index->type & DICT_UNIVERSAL) {
if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) {
/* No fixed number of fields determines an entry uniquely */
new_index->n_uniq = ULINT_MAX;
......@@ -3672,7 +3672,7 @@ dict_tree_find_index_low(
table = index->table;
if ((index->type & DICT_CLUSTERED)
&& (table->type != DICT_TABLE_ORDINARY)) {
&& UNIV_UNLIKELY(table->type != DICT_TABLE_ORDINARY)) {
/* Get the mix id of the record */
ut_a(!table->comp);
......@@ -3828,7 +3828,7 @@ dict_tree_build_node_ptr(
ind = dict_tree_find_index_low(tree, rec);
if (tree->type & DICT_UNIVERSAL) {
if (UNIV_UNLIKELY(tree->type & DICT_UNIVERSAL)) {
/* In a universal index tree, we take the whole record as
the node pointer if the reord is on the leaf level,
on non-leaf levels we remove the last field, which
......@@ -3893,9 +3893,10 @@ dict_tree_copy_rec_order_prefix(
dict_index_t* index;
ulint n;
UNIV_PREFETCH_R(rec);
index = dict_tree_find_index_low(tree, rec);
if (tree->type & DICT_UNIVERSAL) {
if (UNIV_UNLIKELY(tree->type & DICT_UNIVERSAL)) {
ut_a(!index->table->comp);
n = rec_get_n_fields_old(rec);
} else {
......@@ -3947,7 +3948,7 @@ dict_index_calc_min_rec_len(
ulint sum = 0;
ulint i;
if (index->table->comp) {
if (UNIV_LIKELY(index->table->comp)) {
ulint nullable = 0;
sum = REC_N_NEW_EXTRA_BYTES;
for (i = 0; i < dict_index_get_n_fields(index); i++) {
......@@ -4267,9 +4268,11 @@ dict_index_print_low(
putc('\n', stderr);
/* btr_print_size(tree); */
#ifdef UNIV_BTR_PRINT
btr_print_size(tree);
/* btr_print_tree(tree, 7); */
btr_print_tree(tree, 7);
#endif /* UNIV_BTR_PRINT */
}
/**************************************************************************
......
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