Commit 2dd21a58 authored by unknown's avatar unknown

Changed names of statistic variables and counting matches instaed of rejected rows.

parent 729fb83c
...@@ -862,15 +862,15 @@ CREATE TABLE t1 ( ...@@ -862,15 +862,15 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES ('3', '3'),('4','4'),('5','5'); INSERT INTO t1 VALUES ('3', '3'),('4','4'),('5','5');
flush status; flush status;
show status like "Handler_pushed%"; show status like "Handler_icp%";
SELECT * FROM t1 FORCE INDEX(c1) WHERE (c1='3' or c1='4') and c1 % 2 = 0 ; SELECT * FROM t1 FORCE INDEX(c1) WHERE (c1='3' or c1='4') and c1 % 2 = 0 ;
show status like "Handler_pushed%"; show status like "Handler_icp%";
SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ; SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ;
show status like "Handler_pushed%"; show status like "Handler_icp%";
DROP TABLE t1; DROP TABLE t1;
...@@ -816,24 +816,24 @@ KEY (c1) ...@@ -816,24 +816,24 @@ KEY (c1)
); );
INSERT INTO t1 VALUES ('3', '3'),('4','4'),('5','5'); INSERT INTO t1 VALUES ('3', '3'),('4','4'),('5','5');
flush status; flush status;
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 0 Handler_icp_attempts 0
Handler_pushed_index_cond_filtered 0 Handler_icp_match 0
SELECT * FROM t1 FORCE INDEX(c1) WHERE (c1='3' or c1='4') and c1 % 2 = 0 ; SELECT * FROM t1 FORCE INDEX(c1) WHERE (c1='3' or c1='4') and c1 % 2 = 0 ;
c1 c2 c1 c2
4 4 4 4
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 2 Handler_icp_attempts 2
Handler_pushed_index_cond_filtered 1 Handler_icp_match 1
SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ; SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ;
c1 c2 c1 c2
4 4 4 4
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 2 Handler_icp_attempts 2
Handler_pushed_index_cond_filtered 1 Handler_icp_match 1
DROP TABLE t1; DROP TABLE t1;
set optimizer_switch=@innodb_icp_tmp; set optimizer_switch=@innodb_icp_tmp;
set storage_engine= @save_storage_engine; set storage_engine= @save_storage_engine;
...@@ -3520,10 +3520,10 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2; ...@@ -3520,10 +3520,10 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t2 ref f1 f1 4 test.t1.f1 3 Using index condition(BKA); Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t2 ref f1 f1 4 test.t1.f1 3 Using index condition(BKA); Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 20 Handler_icp_attempts 20
Handler_pushed_index_cond_filtered 16 Handler_icp_match 4
set join_cache_level=6; set join_cache_level=6;
select t2.f1, t2.f2, t2.f3 from t1,t2 select t2.f1, t2.f2, t2.f3 from t1,t2
where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1; where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1;
...@@ -3537,10 +3537,10 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2; ...@@ -3537,10 +3537,10 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t2 ref f1 f1 4 test.t1.f1 3 Using index condition(BKA); Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t2 ref f1 f1 4 test.t1.f1 3 Using index condition(BKA); Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 40 Handler_icp_attempts 40
Handler_pushed_index_cond_filtered 32 Handler_icp_match 8
set join_cache_level=7; set join_cache_level=7;
select t2.f1, t2.f2, t2.f3 from t1,t2 select t2.f1, t2.f2, t2.f3 from t1,t2
where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1; where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1;
...@@ -3554,10 +3554,10 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2; ...@@ -3554,10 +3554,10 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t2 ref f1 f1 4 test.t1.f1 3 Using index condition(BKA); Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan 1 SIMPLE t2 ref f1 f1 4 test.t1.f1 3 Using index condition(BKA); Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 60 Handler_icp_attempts 60
Handler_pushed_index_cond_filtered 48 Handler_icp_match 12
set join_cache_level=8; set join_cache_level=8;
select t2.f1, t2.f2, t2.f3 from t1,t2 select t2.f1, t2.f2, t2.f3 from t1,t2
where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1; where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1;
...@@ -3571,10 +3571,10 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2; ...@@ -3571,10 +3571,10 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t2 ref f1 f1 4 test.t1.f1 3 Using index condition(BKA); Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan 1 SIMPLE t2 ref f1 f1 4 test.t1.f1 3 Using index condition(BKA); Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 80 Handler_icp_attempts 80
Handler_pushed_index_cond_filtered 64 Handler_icp_match 16
drop table t1,t2; drop table t1,t2;
set join_cache_level=default; set join_cache_level=default;
# #
......
...@@ -822,24 +822,24 @@ KEY (c1) ...@@ -822,24 +822,24 @@ KEY (c1)
); );
INSERT INTO t1 VALUES ('3', '3'),('4','4'),('5','5'); INSERT INTO t1 VALUES ('3', '3'),('4','4'),('5','5');
flush status; flush status;
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 0 Handler_icp_attempts 0
Handler_pushed_index_cond_filtered 0 Handler_icp_match 0
SELECT * FROM t1 FORCE INDEX(c1) WHERE (c1='3' or c1='4') and c1 % 2 = 0 ; SELECT * FROM t1 FORCE INDEX(c1) WHERE (c1='3' or c1='4') and c1 % 2 = 0 ;
c1 c2 c1 c2
4 4 4 4
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 2 Handler_icp_attempts 2
Handler_pushed_index_cond_filtered 1 Handler_icp_match 1
SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ; SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ;
c1 c2 c1 c2
4 4 4 4
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 2 Handler_icp_attempts 2
Handler_pushed_index_cond_filtered 1 Handler_icp_match 1
DROP TABLE t1; DROP TABLE t1;
set storage_engine= @save_storage_engine; set storage_engine= @save_storage_engine;
set optimizer_switch=@maria_icp_tmp; set optimizer_switch=@maria_icp_tmp;
...@@ -820,24 +820,24 @@ KEY (c1) ...@@ -820,24 +820,24 @@ KEY (c1)
); );
INSERT INTO t1 VALUES ('3', '3'),('4','4'),('5','5'); INSERT INTO t1 VALUES ('3', '3'),('4','4'),('5','5');
flush status; flush status;
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 0 Handler_icp_attempts 0
Handler_pushed_index_cond_filtered 0 Handler_icp_match 0
SELECT * FROM t1 FORCE INDEX(c1) WHERE (c1='3' or c1='4') and c1 % 2 = 0 ; SELECT * FROM t1 FORCE INDEX(c1) WHERE (c1='3' or c1='4') and c1 % 2 = 0 ;
c1 c2 c1 c2
4 4 4 4
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 2 Handler_icp_attempts 2
Handler_pushed_index_cond_filtered 1 Handler_icp_match 1
SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ; SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ;
c1 c2 c1 c2
4 4 4 4
show status like "Handler_pushed%"; show status like "Handler_icp%";
Variable_name Value Variable_name Value
Handler_pushed_index_cond_checks 2 Handler_icp_attempts 2
Handler_pushed_index_cond_filtered 1 Handler_icp_match 1
DROP TABLE t1; DROP TABLE t1;
drop table if exists t0, t1, t1i, t1m; drop table if exists t0, t1, t1i, t1m;
# #
......
...@@ -275,9 +275,9 @@ Variable_name Value ...@@ -275,9 +275,9 @@ Variable_name Value
Handler_commit 0 Handler_commit 0
Handler_delete 0 Handler_delete 0
Handler_discover 0 Handler_discover 0
Handler_icp_attempts 0
Handler_icp_match 0
Handler_prepare 0 Handler_prepare 0
Handler_pushed_index_cond_checks 0
Handler_pushed_index_cond_filtered 0
Handler_read_first 0 Handler_read_first 0
Handler_read_key 4 Handler_read_key 4
Handler_read_next 0 Handler_read_next 0
...@@ -312,9 +312,9 @@ Variable_name Value ...@@ -312,9 +312,9 @@ Variable_name Value
Handler_commit 0 Handler_commit 0
Handler_delete 0 Handler_delete 0
Handler_discover 0 Handler_discover 0
Handler_icp_attempts 0
Handler_icp_match 0
Handler_prepare 0 Handler_prepare 0
Handler_pushed_index_cond_checks 0
Handler_pushed_index_cond_filtered 0
Handler_read_first 0 Handler_read_first 0
Handler_read_key 2 Handler_read_key 2
Handler_read_next 2 Handler_read_next 2
......
...@@ -100,9 +100,9 @@ Variable_name Value ...@@ -100,9 +100,9 @@ Variable_name Value
Handler_commit 19 Handler_commit 19
Handler_delete 1 Handler_delete 1
Handler_discover 0 Handler_discover 0
Handler_icp_attempts 0
Handler_icp_match 0
Handler_prepare 18 Handler_prepare 18
Handler_pushed_index_cond_checks 0
Handler_pushed_index_cond_filtered 0
Handler_read_first 0 Handler_read_first 0
Handler_read_key 3 Handler_read_key 3
Handler_read_next 0 Handler_read_next 0
......
...@@ -1533,7 +1533,7 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1; ...@@ -1533,7 +1533,7 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1;
explain select t2.f1, t2.f2, t2.f3 from t1,t2 explain select t2.f1, t2.f2, t2.f3 from t1,t2
where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2; where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
show status like "Handler_pushed%"; show status like "Handler_icp%";
set join_cache_level=6; set join_cache_level=6;
select t2.f1, t2.f2, t2.f3 from t1,t2 select t2.f1, t2.f2, t2.f3 from t1,t2
...@@ -1541,7 +1541,7 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1; ...@@ -1541,7 +1541,7 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1;
explain select t2.f1, t2.f2, t2.f3 from t1,t2 explain select t2.f1, t2.f2, t2.f3 from t1,t2
where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2; where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
show status like "Handler_pushed%"; show status like "Handler_icp%";
set join_cache_level=7; set join_cache_level=7;
select t2.f1, t2.f2, t2.f3 from t1,t2 select t2.f1, t2.f2, t2.f3 from t1,t2
...@@ -1549,7 +1549,7 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1; ...@@ -1549,7 +1549,7 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1;
explain select t2.f1, t2.f2, t2.f3 from t1,t2 explain select t2.f1, t2.f2, t2.f3 from t1,t2
where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2; where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
show status like "Handler_pushed%"; show status like "Handler_icp%";
set join_cache_level=8; set join_cache_level=8;
select t2.f1, t2.f2, t2.f3 from t1,t2 select t2.f1, t2.f2, t2.f3 from t1,t2
...@@ -1557,7 +1557,7 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1; ...@@ -1557,7 +1557,7 @@ where t1.f1=t2.f1 and t2.f2 between t1.f1 and t1.f2 and t2.f2 + 1 >= t1.f1 + 1;
explain select t2.f1, t2.f2, t2.f3 from t1,t2 explain select t2.f1, t2.f2, t2.f3 from t1,t2
where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2; where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
show status like "Handler_pushed%"; show status like "Handler_icp%";
drop table t1,t2; drop table t1,t2;
set join_cache_level=default; set join_cache_level=default;
......
...@@ -4569,10 +4569,10 @@ extern "C" enum icp_result handler_index_cond_check(void* h_arg) ...@@ -4569,10 +4569,10 @@ extern "C" enum icp_result handler_index_cond_check(void* h_arg)
if (h->end_range && h->compare_key2(h->end_range) > 0) if (h->end_range && h->compare_key2(h->end_range) > 0)
return ICP_OUT_OF_RANGE; return ICP_OUT_OF_RANGE;
h->increment_statistics(&SSV::ha_pushed_index_cond_checks); h->increment_statistics(&SSV::ha_icp_attempts);
if ((res= h->pushed_idx_cond->val_int()? ICP_MATCH : ICP_NO_MATCH) == if ((res= h->pushed_idx_cond->val_int()? ICP_MATCH : ICP_NO_MATCH) ==
ICP_NO_MATCH) ICP_MATCH)
h->increment_statistics(&SSV::ha_pushed_index_cond_filtered); h->increment_statistics(&SSV::ha_icp_match);
return res; return res;
} }
......
...@@ -8107,9 +8107,9 @@ SHOW_VAR status_vars[]= { ...@@ -8107,9 +8107,9 @@ SHOW_VAR status_vars[]= {
{"Handler_mrr_extra_rowid_sorts", (char*) offsetof(STATUS_VAR, ha_mrr_extra_rowid_sorts), SHOW_LONG_STATUS}, {"Handler_mrr_extra_rowid_sorts", (char*) offsetof(STATUS_VAR, ha_mrr_extra_rowid_sorts), SHOW_LONG_STATUS},
{"Handler_mrr_init", (char*) offsetof(STATUS_VAR, ha_multi_range_read_init_count), SHOW_LONG_STATUS}, {"Handler_mrr_init", (char*) offsetof(STATUS_VAR, ha_multi_range_read_init_count), SHOW_LONG_STATUS},
#endif #endif
{"Handler_icp_attempts ", (char*) offsetof(STATUS_VAR, ha_icp_attempts), SHOW_LONG_STATUS},
{"Handler_icp_match", (char*) offsetof(STATUS_VAR, ha_icp_match), SHOW_LONG_STATUS},
{"Handler_prepare", (char*) offsetof(STATUS_VAR, ha_prepare_count), SHOW_LONG_STATUS}, {"Handler_prepare", (char*) offsetof(STATUS_VAR, ha_prepare_count), SHOW_LONG_STATUS},
{"Handler_pushed_index_cond_checks",(char*) offsetof(STATUS_VAR, ha_pushed_index_cond_checks), SHOW_LONG_STATUS},
{"Handler_pushed_index_cond_filtered",(char*) offsetof(STATUS_VAR, ha_pushed_index_cond_filtered), SHOW_LONG_STATUS},
{"Handler_read_first", (char*) offsetof(STATUS_VAR, ha_read_first_count), SHOW_LONG_STATUS}, {"Handler_read_first", (char*) offsetof(STATUS_VAR, ha_read_first_count), SHOW_LONG_STATUS},
{"Handler_read_key", (char*) offsetof(STATUS_VAR, ha_read_key_count), SHOW_LONG_STATUS}, {"Handler_read_key", (char*) offsetof(STATUS_VAR, ha_read_key_count), SHOW_LONG_STATUS},
{"Handler_read_next", (char*) offsetof(STATUS_VAR, ha_read_next_count), SHOW_LONG_STATUS}, {"Handler_read_next", (char*) offsetof(STATUS_VAR, ha_read_next_count), SHOW_LONG_STATUS},
......
...@@ -588,8 +588,8 @@ typedef struct system_status_var ...@@ -588,8 +588,8 @@ typedef struct system_status_var
ulong ha_tmp_update_count; ulong ha_tmp_update_count;
ulong ha_tmp_write_count; ulong ha_tmp_write_count;
ulong ha_prepare_count; ulong ha_prepare_count;
ulong ha_pushed_index_cond_checks; ulong ha_icp_attempts;
ulong ha_pushed_index_cond_filtered; ulong ha_icp_match;
ulong ha_discover_count; ulong ha_discover_count;
ulong ha_savepoint_count; ulong ha_savepoint_count;
ulong ha_savepoint_rollback_count; ulong ha_savepoint_rollback_count;
......
...@@ -4026,9 +4026,9 @@ bool bka_skip_index_tuple(range_seq_t rseq, range_id_t range_info) ...@@ -4026,9 +4026,9 @@ bool bka_skip_index_tuple(range_seq_t rseq, range_id_t range_info)
JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq; JOIN_CACHE_BKA *cache= (JOIN_CACHE_BKA *) rseq;
THD *thd= cache->thd(); THD *thd= cache->thd();
bool res; bool res;
status_var_increment(thd->status_var.ha_pushed_index_cond_checks); status_var_increment(thd->status_var.ha_icp_attempts);
if ((res= cache->skip_index_tuple(range_info))) if (!(res= cache->skip_index_tuple(range_info)))
status_var_increment(thd->status_var.ha_pushed_index_cond_filtered); status_var_increment(thd->status_var.ha_icp_match);
DBUG_RETURN(res); DBUG_RETURN(res);
} }
...@@ -4505,9 +4505,9 @@ bool bkah_skip_index_tuple(range_seq_t rseq, range_id_t range_info) ...@@ -4505,9 +4505,9 @@ bool bkah_skip_index_tuple(range_seq_t rseq, range_id_t range_info)
JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq; JOIN_CACHE_BKAH *cache= (JOIN_CACHE_BKAH *) rseq;
THD *thd= cache->thd(); THD *thd= cache->thd();
bool res; bool res;
status_var_increment(thd->status_var.ha_pushed_index_cond_checks); status_var_increment(thd->status_var.ha_icp_attempts);
if ((res= cache->skip_index_tuple(range_info))) if (!(res= cache->skip_index_tuple(range_info)))
status_var_increment(thd->status_var.ha_pushed_index_cond_filtered); status_var_increment(thd->status_var.ha_icp_match);
DBUG_RETURN(res); DBUG_RETURN(res);
} }
......
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