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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a11a1019
Commit
a11a1019
authored
Mar 29, 2024
by
Dave Gosselin
Committed by
Sergei Petrunia
Apr 23, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accrue statistics to correct handler
parent
0940a969
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
sql/handler.cc
sql/handler.cc
+3
-2
sql/handler.h
sql/handler.h
+7
-1
sql/sql_explain.cc
sql/sql_explain.cc
+7
-7
No files found.
sql/handler.cc
View file @
a11a1019
...
...
@@ -6995,6 +6995,7 @@ extern "C" check_result_t handler_index_cond_check(void* h_arg)
check_result_t
res
;
DEBUG_SYNC
(
thd
,
"handler_index_cond_check"
);
DBUG_ASSERT
(
h
->
handler_stats
);
enum
thd_kill_levels
killed
=
thd_kill_level
(
thd
);
if
(
unlikely
(
killed
!=
THD_IS_NOT_KILLED
))
...
...
@@ -7008,13 +7009,13 @@ extern "C" check_result_t handler_index_cond_check(void* h_arg)
if
(
unlikely
(
h
->
end_range
)
&&
h
->
compare_key2
(
h
->
end_range
)
>
0
)
return
CHECK_OUT_OF_RANGE
;
h
->
increment_statistics
(
&
SSV
::
ha_icp_attempts
);
h
->
active_handler_stats
.
icp_attempts
++
;
h
->
handler_stats
->
icp_attempts
++
;
res
=
CHECK_NEG
;
if
(
h
->
pushed_idx_cond
->
val_int
())
{
res
=
CHECK_POS
;
h
->
fast_increment_statistics
(
&
SSV
::
ha_icp_match
);
h
->
active_handler_stats
.
icp_match
++
;
h
->
handler_stats
->
icp_match
++
;
}
return
res
;
}
...
...
sql/handler.h
View file @
a11a1019
...
...
@@ -3211,7 +3211,13 @@ class handler :public Sql_alloc
ha_rows
estimation_rows_to_insert
;
handler
*
lookup_handler
;
/* Statistics for the query. Updated if handler_stats.in_use is set */
/*
Statistics for the query. Prefer to use the handler_stats pointer
below rather than this object directly as the clone() method will
modify how stats are accounted by adjusting the handler_stats
pointer. Referring to active_handler_stats directly will yield
surprising and possibly incorrect results.
*/
ha_handler_stats
active_handler_stats
;
void
set_handler_stats
();
public:
...
...
sql/sql_explain.cc
View file @
a11a1019
...
...
@@ -1938,13 +1938,13 @@ static void trace_engine_stats(handler *file, Json_writer *writer)
static
void
print_r_icp_filtered
(
handler
*
file
,
Json_writer
*
writer
)
{
if
(
file
&&
file
->
handler_stats
&&
file
->
pushed_idx_cond
)
{
ha_handler_stats
*
hs
=
file
->
handler_stats
;
double
r_icp_filtered
=
hs
->
icp_attempts
?
(
double
)(
hs
->
icp_match
)
/
(
double
)(
hs
->
icp_attempts
)
:
1.0
;
writer
->
add_member
(
"r_icp_filtered"
).
add_double
(
r_icp_filtered
*
100
)
;
}
if
(
!
file
||
!
file
->
handler_stats
||
!
file
->
pushed_idx_cond
)
return
;
ha_handler_stats
*
hs
=
file
->
handler_stats
;
double
r_icp_filtered
=
hs
->
icp_attempts
?
(
double
)(
hs
->
icp_match
)
/
(
double
)(
hs
->
icp_attempts
)
:
0.0
;
writer
->
add_member
(
"r_icp_filtered"
).
add_double
(
r_icp_filtered
*
100
);
}
void
Explain_table_access
::
print_explain_json
(
Explain_query
*
query
,
...
...
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