Commit 70a2e99e authored by marko's avatar marko

Disable the statistics variables btr_search_n_hash_fail and

n_hash_succ, n_hash_fail, n_patt_succ, and n_searches of btr_search_t
in builds without #ifdef UNIV_SEARCH_PERF_STAT.
parent 6cd0ecdd
...@@ -24,8 +24,8 @@ ulint btr_search_this_is_zero = 0; /* A dummy variable to fool the ...@@ -24,8 +24,8 @@ ulint btr_search_this_is_zero = 0; /* A dummy variable to fool the
#ifdef UNIV_SEARCH_PERF_STAT #ifdef UNIV_SEARCH_PERF_STAT
ulint btr_search_n_succ = 0; ulint btr_search_n_succ = 0;
#endif /* UNIV_SEARCH_PERF_STAT */
ulint btr_search_n_hash_fail = 0; ulint btr_search_n_hash_fail = 0;
#endif /* UNIV_SEARCH_PERF_STAT */
byte btr_sea_pad1[64]; /* padding to prevent other memory update byte btr_sea_pad1[64]; /* padding to prevent other memory update
hotspots from residing on the same memory hotspots from residing on the same memory
...@@ -169,10 +169,12 @@ btr_search_info_create( ...@@ -169,10 +169,12 @@ btr_search_info_create(
info->last_hash_succ = FALSE; info->last_hash_succ = FALSE;
#ifdef UNIV_SEARCH_PERF_STAT
info->n_hash_succ = 0; info->n_hash_succ = 0;
info->n_hash_fail = 0; info->n_hash_fail = 0;
info->n_patt_succ = 0; info->n_patt_succ = 0;
info->n_searches = 0; info->n_searches = 0;
#endif /* UNIV_SEARCH_PERF_STAT */
/* Set some sensible values */ /* Set some sensible values */
info->n_fields = 1; info->n_fields = 1;
...@@ -484,7 +486,9 @@ btr_search_info_update_slow( ...@@ -484,7 +486,9 @@ btr_search_info_update_slow(
if (cursor->flag == BTR_CUR_HASH_FAIL) { if (cursor->flag == BTR_CUR_HASH_FAIL) {
/* Update the hash node reference, if appropriate */ /* Update the hash node reference, if appropriate */
#ifdef UNIV_SEARCH_PERF_STAT
btr_search_n_hash_fail++; btr_search_n_hash_fail++;
#endif /* UNIV_SEARCH_PERF_STAT */
rw_lock_x_lock(&btr_search_latch); rw_lock_x_lock(&btr_search_latch);
...@@ -869,11 +873,11 @@ failure_unlock: ...@@ -869,11 +873,11 @@ failure_unlock:
rw_lock_s_unlock(&btr_search_latch); rw_lock_s_unlock(&btr_search_latch);
} }
failure: failure:
info->n_hash_fail++;
cursor->flag = BTR_CUR_HASH_FAIL; cursor->flag = BTR_CUR_HASH_FAIL;
#ifdef UNIV_SEARCH_PERF_STAT #ifdef UNIV_SEARCH_PERF_STAT
info->n_hash_fail++;
if (info->n_hash_succ > 0) { if (info->n_hash_succ > 0) {
info->n_hash_succ--; info->n_hash_succ--;
} }
......
...@@ -180,12 +180,14 @@ struct btr_search_struct{ ...@@ -180,12 +180,14 @@ struct btr_search_struct{
the same prefix should be indexed in the the same prefix should be indexed in the
hash index */ hash index */
/*----------------------*/ /*----------------------*/
#ifdef UNIV_SEARCH_PERF_STAT
ulint n_hash_succ; /* number of successful hash searches thus ulint n_hash_succ; /* number of successful hash searches thus
far */ far */
ulint n_hash_fail; /* number of failed hash searches */ ulint n_hash_fail; /* number of failed hash searches */
ulint n_patt_succ; /* number of successful pattern searches thus ulint n_patt_succ; /* number of successful pattern searches thus
far */ far */
ulint n_searches; /* number of searches */ ulint n_searches; /* number of searches */
#endif /* UNIV_SEARCH_PERF_STAT */
}; };
#define BTR_SEARCH_MAGIC_N 1112765 #define BTR_SEARCH_MAGIC_N 1112765
...@@ -218,8 +220,8 @@ extern rw_lock_t* btr_search_latch_temp; ...@@ -218,8 +220,8 @@ extern rw_lock_t* btr_search_latch_temp;
#ifdef UNIV_SEARCH_PERF_STAT #ifdef UNIV_SEARCH_PERF_STAT
extern ulint btr_search_n_succ; extern ulint btr_search_n_succ;
#endif /* UNIV_SEARCH_PERF_STAT */
extern ulint btr_search_n_hash_fail; extern ulint btr_search_n_hash_fail;
#endif /* UNIV_SEARCH_PERF_STAT */
/* After change in n_fields or n_bytes in info, this many rounds are waited /* After change in n_fields or n_bytes in info, this many rounds are waited
before starting the hash analysis again: this is to save CPU time when there before starting the hash analysis again: this is to save CPU time when there
......
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