Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
59b2bb9a
Commit
59b2bb9a
authored
Feb 22, 2012
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added back MRR counters. The new names are: Handler_mrr_init,
Handler_mrr_key_refills, Handler_mrr_rowid_refills.
parent
c299e027
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
14 deletions
+41
-14
mysql-test/r/myisam_mrr.result
mysql-test/r/myisam_mrr.result
+15
-0
mysql-test/r/status.result
mysql-test/r/status.result
+7
-1
mysql-test/r/status_user.result
mysql-test/r/status_user.result
+3
-0
sql/multi_range_read.cc
sql/multi_range_read.cc
+8
-4
sql/mysqld.cc
sql/mysqld.cc
+5
-6
sql/sql_class.h
sql/sql_class.h
+3
-3
No files found.
mysql-test/r/myisam_mrr.result
View file @
59b2bb9a
...
...
@@ -563,6 +563,9 @@ drop table t1;
flush status;
show status like 'Handler_mrr%';
Variable_name Value
Handler_mrr_init 0
Handler_mrr_key_refills 0
Handler_mrr_rowid_refills 0
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, filler char(200), key(a));
...
...
@@ -578,6 +581,9 @@ sum(b)
1230
show status like 'handler_mrr%';
Variable_name Value
Handler_mrr_init 1
Handler_mrr_key_refills 0
Handler_mrr_rowid_refills 0
set @mrr_buffer_size_save= @@mrr_buffer_size;
set mrr_buffer_size=128;
explain select sum(b) from t1 where a < 1600;
...
...
@@ -590,6 +596,9 @@ sum(b)
196800
show status like 'handler_mrr%';
Variable_name Value
Handler_mrr_init 1
Handler_mrr_key_refills 0
Handler_mrr_rowid_refills 1
set @@mrr_buffer_size= @mrr_buffer_size_save;
#Now, let's check BKA:
set @join_cache_level_save= @@join_cache_level;
...
...
@@ -605,6 +614,9 @@ sum(t1.b)
1230
show status like 'handler_mrr%';
Variable_name Value
Handler_mrr_init 1
Handler_mrr_key_refills 0
Handler_mrr_rowid_refills 0
set join_buffer_size=10;
explain select sum(t1.b) from t0,t1 where t0.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
...
...
@@ -616,6 +628,9 @@ sum(t1.b)
1230
show status like 'handler_mrr%';
Variable_name Value
Handler_mrr_init 1or2
Handler_mrr_key_refills 1or2
Handler_mrr_rowid_refills 1or2
set join_cache_level= @join_cache_level_save;
set join_buffer_size= @join_buffer_size_save;
drop table t0, t1;
...
...
mysql-test/r/status.result
View file @
59b2bb9a
...
...
@@ -277,6 +277,9 @@ Handler_delete 0
Handler_discover 0
Handler_icp_attempts 0
Handler_icp_match 0
Handler_mrr_init 0
Handler_mrr_key_refills 0
Handler_mrr_rowid_refills 0
Handler_prepare 0
Handler_read_first 0
Handler_read_key 4
...
...
@@ -299,7 +302,7 @@ Created_tmp_files 0
Created_tmp_tables 2
Handler_tmp_update 2
Handler_tmp_write 7
Rows_tmp_read
37
Rows_tmp_read
40
drop table t1;
CREATE TABLE t1 (i int(11) DEFAULT NULL, KEY i (i) ) ENGINE=MyISAM;
insert into t1 values (1),(2),(3),(4),(5);
...
...
@@ -314,6 +317,9 @@ Handler_delete 0
Handler_discover 0
Handler_icp_attempts 0
Handler_icp_match 0
Handler_mrr_init 0
Handler_mrr_key_refills 0
Handler_mrr_rowid_refills 0
Handler_prepare 0
Handler_read_first 0
Handler_read_key 2
...
...
mysql-test/r/status_user.result
View file @
59b2bb9a
...
...
@@ -102,6 +102,9 @@ Handler_delete 1
Handler_discover 0
Handler_icp_attempts 0
Handler_icp_match 0
Handler_mrr_init 0
Handler_mrr_key_refills 0
Handler_mrr_rowid_refills 0
Handler_prepare 18
Handler_read_first 0
Handler_read_key 3
...
...
sql/multi_range_read.cc
View file @
59b2bb9a
...
...
@@ -510,7 +510,7 @@ int Mrr_ordered_index_reader::refill_buffer(bool initial)
{
/* This is a non-initial buffer fill and we've got a non-empty buffer */
THD
*
thd
=
current_thd
;
status_var_increment
(
thd
->
status_var
.
ha_mrr_
extra_key_sorts
);
status_var_increment
(
thd
->
status_var
.
ha_mrr_
key_refills_count
);
}
key_buffer
->
sort
((
key_buffer
->
type
()
==
Lifo_buffer
::
FORWARD
)
?
...
...
@@ -610,7 +610,7 @@ int Mrr_ordered_rndpos_reader::refill_buffer(bool initial)
{
/* Ok, this was a successful buffer refill operation */
THD
*
thd
=
current_thd
;
status_var_increment
(
thd
->
status_var
.
ha_mrr_
extra_rowid_sorts
);
status_var_increment
(
thd
->
status_var
.
ha_mrr_
rowid_refills_count
);
}
DBUG_RETURN
(
res
);
...
...
@@ -845,8 +845,6 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
strategy
=
disk_strategy
=
&
reader_factory
.
ordered_rndpos_reader
;
}
status_var_increment
(
thd
->
status_var
.
ha_multi_range_read_init_count
);
full_buf
=
buf
->
buffer
;
full_buf_end
=
buf
->
buffer_end
;
...
...
@@ -936,6 +934,12 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
goto
error
;
}
}
/*
At this point, we're sure that we're running a native MRR scan (i.e. we
didnt fall back to default implementation for some reason).
*/
status_var_increment
(
thd
->
status_var
.
ha_mrr_init_count
);
res
=
strategy
->
refill_buffer
(
TRUE
);
if
(
res
)
...
...
sql/mysqld.cc
View file @
59b2bb9a
...
...
@@ -8101,12 +8101,11 @@ SHOW_VAR status_vars[]= {
{
"Handler_commit"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
ha_commit_count
),
SHOW_LONG_STATUS
},
{
"Handler_delete"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
ha_delete_count
),
SHOW_LONG_STATUS
},
{
"Handler_discover"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
ha_discover_count
),
SHOW_LONG_STATUS
},
#if 0
/* Made 3 counters below temporarily invisible until we agree upon their names */
{"Handler_mrr_extra_key_sorts", (char*) offsetof(STATUS_VAR, ha_mrr_extra_key_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},
#endif
{
"Handler_mrr_key_refills"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
ha_mrr_key_refills_count
),
SHOW_LONG_STATUS
},
{
"Handler_mrr_rowid_refills"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
ha_mrr_rowid_refills_count
),
SHOW_LONG_STATUS
},
{
"Handler_mrr_init"
,
(
char
*
)
offsetof
(
STATUS_VAR
,
ha_mrr_init_count
),
SHOW_LONG_STATUS
},
{
"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
},
...
...
sql/sql_class.h
View file @
59b2bb9a
...
...
@@ -577,9 +577,9 @@ typedef struct system_status_var
calls made by range access. The intent is to count only calls made by
BatchedKeyAccess.
*/
ulong
ha_m
ulti_range_read
_init_count
;
ulong
ha_mrr_
extra_key_sorts
;
ulong
ha_mrr_
extra_rowid_sorts
;
ulong
ha_m
rr
_init_count
;
ulong
ha_mrr_
key_refills_count
;
ulong
ha_mrr_
rowid_refills_count
;
ulong
ha_rollback_count
;
ulong
ha_update_count
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment