Web Programming, Linux System Administation, and Entrepreneurship in Athens Georgia

Query to view the InnoDB History List Length

The InnoDB History List Length is an important metric the I continuously need to check and monitor. Especially on database servers with a write-heavy workload. I’ve been bitten several times when the MySQL server seems to be operating fine, but it gets a huge backlog of writes.

You can issue the show engine innodb status; command to see the whole InnoDB status, which includes the History List Length, like this:

------------
TRANSACTIONS
------------
Trx id counter 725255284309
Purge done for trx's n:o < 725255284309 undo n:o < 0 state: running but idle
History list length 12

But that can be easily lost in the huge wall of text.

Somewhere around the release of MySQL 8, you can obtain this important metric from a straightforward query

select count from information_schema.innodb_metrics where name = 'trx_rseg_history_len';

mysql> select count from information_schema.innodb_metrics where name = 'trx_rseg_history_len';
+-------+
| count |
+-------+
|    16 |
+-------+
1 row in set (0.01 sec)

I've you're an AWS / RDS customer, I'd love to have the History List Length to be a native graph available with all MySQL instances. I wrote a request for this on AWS re:Post if you feel like voting it up.

1 Comment

  1. Brandon Checketts

    Update: This value is charted now when Performance Insights is enabled on MySQL RDS instances

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2025 Brandon Checketts

Theme by Anders NorenUp ↑