summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-02-16 08:49:10 +0200
committerunknown <sanja@montyprogram.com>2012-02-16 08:49:10 +0200
commit607aab9c1d68a3b80bdb52a6c73fd6be1aa52764 (patch)
tree3e608459856b6def8c6067cf6b75af813d931585 /sql/sql_join_cache.cc
parent764eeeee74f999fe2107fc362236563be0025093 (diff)
downloadmariadb-git-607aab9c1d68a3b80bdb52a6c73fd6be1aa52764.tar.gz
Counters for Index Condition Pushdown added (MDEV-130).
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 78f95a7ac7e..15b5efbfacb 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -2576,6 +2576,15 @@ void JOIN_CACHE::print_explain_comment(String *str)
str->append(STRING_WITH_LEN(")"));
}
+/**
+ get thread handle.
+*/
+
+THD *JOIN_CACHE::thd()
+{
+ return join->thd;
+}
+
static void add_mrr_explain_info(String *str, uint mrr_mode, handler *file)
{
@@ -4015,7 +4024,11 @@ bool bka_skip_index_tuple(range_seq_t rseq, range_id_t range_info)
{
DBUG_ENTER("bka_skip_index_tuple");
JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
- bool res= cache->skip_index_tuple(range_info);
+ THD *thd= cache->thd();
+ bool res;
+ status_var_increment(thd->status_var.ha_pushed_index_cond_checks);
+ if ((res= cache->skip_index_tuple(range_info)))
+ status_var_increment(thd->status_var.ha_pushed_index_cond_filtered);
DBUG_RETURN(res);
}
@@ -4490,7 +4503,12 @@ bool bkah_skip_index_tuple(range_seq_t rseq, range_id_t range_info)
{
DBUG_ENTER("bka_unique_skip_index_tuple");
JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
- DBUG_RETURN(cache->skip_index_tuple(range_info));
+ THD *thd= cache->thd();
+ bool res;
+ status_var_increment(thd->status_var.ha_pushed_index_cond_checks);
+ if ((res= cache->skip_index_tuple(range_info)))
+ status_var_increment(thd->status_var.ha_pushed_index_cond_filtered);
+ DBUG_RETURN(res);
}