After nearly every recovery case the same question arises: How many MySQL records were recovered and how many were lost.
Until now there was no way to answer the question without manual investigation. As it turned out a small change can make a big difference.
There are two ways to know how many records an InnoDB page stores. The index page has a header PAGE_N_RECS – this is a number of records the page stores. Obviously it doesn’t count any deleted records. The second method to confirm how many records are in the page is to follow records pointers – and count them.
As you might know, records inside an InnoDB page are organized in
an unidirectional list. The list is sorted by primary key and
starts with the internal record infinum
and ends
with another internal record supremum
. If you …