summaryrefslogtreecommitdiff
path: root/innobase/dict
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-04-22 13:43:49 +0300
committerunknown <marko@hundin.mysql.fi>2005-04-22 13:43:49 +0300
commitf2c13c3f4fa493e4054e9d6c34a82d80af2bbafc (patch)
tree061df942ec78981c46d0f62aaa20d175b1aa7533 /innobase/dict
parentc546b5f3b566d3e2b0e970c0313244823cb8c9a8 (diff)
downloadmariadb-git-f2c13c3f4fa493e4054e9d6c34a82d80af2bbafc.tar.gz
dict0dict.c:
Add some UNIV_LIKELY and UNIV_UNLIKELY hints. dict_tree_copy_rec_order_prefix(): Add a UNIV_PREFETCH_R hint on rec. innobase/dict/dict0dict.c: Add some UNIV_LIKELY and UNIV_UNLIKELY hints. dict_tree_copy_rec_order_prefix(): Add a UNIV_PREFETCH_R hint on rec.
Diffstat (limited to 'innobase/dict')
-rw-r--r--innobase/dict/dict0dict.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 8c9724da079..4df2bb21e03 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -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 */
}
/**************************************************************************