How to check innodb history list length?

Posted on

Question :

The output for show engine innodb status has the history list length as a number, but that output is hard to parse, and there’s just too much data when all you want is a single value. Is the value available somewhere else that can be fetched as a row?

Answer :

I can’t find documentation confirming it anywhere, but I think it’s:

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

The closest thing to a confirmation is a bug report referring to this counter as the history list length. Also, the current, min and max values match the logs I have recorded. It would be nice if someone familiar with the MySQL source code could confirm it.

Depends on what version you have. Here is the STATUS value:


Description: History list length as shown in the TRANSACTIONS
    section of the SHOW ENGINE INNODB STATUS output.
Scope: Global
Data Type: numeric
Introduced: MariaDB 5.5 / XtraDB 5.5.8-20 

(quoted from:)

So I would expect the ‘fetch’ to look like

     FROM information_schema.GLOBAL_STATUS
     WHERE VARIABLE_NAME = 'Innodb_history_list_length'; 

Leave a Reply

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