Details
Description
Discovered this in MDEV-33446,
https://jira.mariadb.org/browse/MDEV-33446?focusedCommentId=282972&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-282972
"r_table_time_ms": 1 425 235.95, |
"r_other_time_ms": 397318.6493, |
"r_engine_stats": { |
"pages_accessed": 1850995, |
"pages_read_count": 35272, |
"pages_read_time_ms": 14 657 261.27 |
},
|
^ an ANALYZE output where the value of r_engine_stats.pages_read_time_ms doesn't make much sense: it is larger than the query's total r_total_time_ms.
The cause
Code from MDEV-31577:
trace_engine_stats():
writer->add_member("pages_read_time_ms"). |
add_double(hs->pages_read_time / 1000.0);
|
it's divided by 1000, because according the definition it's microseconds:
class ha_handler_stats |
{
|
...
|
ulonglong pages_read_time; /* Time reading pages, in microsec. */ |
On the other hand, it is printed into the slow query log like this: MYSQL_QUERY_LOG::write():
double tracker_frequency= timer_tracker_frequency(); |
sprintf(query_time_buff, "%.4f", |
1000.0 * ulonglong2double(stats->pages_read_time)/
|
tracker_frequency);
|
Attachments
Issue Links
- relates to
-
MDEV-33446 optimizer is wrong
- Open
-
MDEV-34251 Conditional jump or move depends on uninitialised value in ha_handler_stats::has_stats
- Closed
-
MDEV-34190 ANALYZE: r_engine_stats shows unrealistically low pages_read_count
- Closed