[MDEV-31558] Add InnoDB engine information to the slow query log Created: 2023-06-27 Updated: 2023-11-30 Resolved: 2023-07-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.6.15, 10.9.8, 10.10.6, 10.11.5 |
| Type: | Task | Priority: | Critical |
| Reporter: | Michael Widenius | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
Percona server has some useful InnoDB status information in the slow query log. This task is to add some of the most useful ones, but with less code. The current task will add the following new information to the slow query log if enabled with
Engine_time is how many milliseconds is spent inside engine calls (similar as with analyze). |
| Comments |
| Comment by Marko Mäkelä [ 2023-06-27 ] | ||||||||||||||||||||||||||||||||||||||||||
|
To assess the impact of purge lag ( Possibly, we could add another counter at the high level (say, trx_undo_prev_version_build(), row_vers_impl_x_locked_low()) for tracking undo log record access, and let the page counters cover all types of page reads. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2023-06-28 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Undo_rows_read added | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-06-30 ] | ||||||||||||||||||||||||||||||||||||||||||
|
The undo_records_read that monty added to trx_undo_prev_version_build() is covering also "semi-consistent reads" and implicit lock checks. So, the code is complete. I would like to see this being pushed to 10.6 after some performance and correctness testing. psergei implemented an ANALYZE interface and helped me develop the following test case, which I think should be added so that we will have some validation that the counters actually work:
This test case actually revealed a performance bug. There is only 1 record in the table, with 2 versions, yet the previous version of the clustered index record will be fetched twice in Row_sel_get_clust_rec_for_mysql::operator(). I will have to check how the logic would be if I revert | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-06-30 ] | ||||||||||||||||||||||||||||||||||||||||||
|
I filed MDEV-31589 for the anomaly. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2023-07-07 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Backporting code to 10.6 (original code was for 10.11) |