[MDEV-28539] Some InnoDB counters are duplicating generic SHOW STATUS Created: 2022-05-11 Updated: 2024-01-16 Resolved: 2022-06-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.10.0 |
| Type: | Task | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance | ||
| Issue Links: |
|
||||||||||||
| Description |
|
The InnoDB srv_stats counters n_rows_updated, n_rows_deleted, n_rows_inserted, and n_rows_read are duplicating Handler_update, Handler_delete, Handler_write, and various Handler_read_ counters. Updating those counters is not free, especially because some counters are furthermore split to distinguish a rare case of modifying tables in the system schema:
On a related note, handler::increment_statistics() which updates the common status variables, does not employ any caching or sharding whatsoever. It could be better to first update the counters directly in handler data members and only update global counts at the end of each statement. |
| Comments |
| Comment by Tingyao Nian [ 2023-08-10 ] |
|
Add my comment here same as MDEV-31772:
|
| Comment by Marko Mäkelä [ 2024-01-16 ] |
|
The Handler_update, Handler_delete, Handler_write status variables as well as the various Handler_read_ counters indeed cover access to any storage engine. In information_schema.rocksdb_trx you can apparently find a transaction-level write_count but nothing on reads. For internal temporary tables that may be used by operations like JOIN, ORDER BY or GROUP BY, there are separate counters Handler_tmp_delete, Handler_tmp_update, Handler_tmp_write, and nothing on reads. |