How to check frequency of redo log switching?

Sorry for this basic question but I can’t seem to find a table that will show me the frequency of redo log switching. How do I know when a log switched?
In oracle there is a v$log_history table which has the times when a log switched.
I don’t see anything in the errorlog either when logs switch.

1 Like

I know that you know MySQL is not Oracle, thus a behavior you see in Oracle will not always be in MySQL. My initial question is “why do you need to know this?” What are you looking for with this metric?

In MySQL, InnoDB specifically, there are by default only 2 redo logs which are used consecutively then wrapped around back to the beginning of the first log. Is that “switching”?

It doesn’t matter how often you ‘switch’ back to the beginning. What matters is ‘when you do wrap around, are there transactions that have not been flushed to tablespace?’ That’s the killer metric for performance. If there are txns that have not been flushed, that means your redo logs are too small to handle your transaction volume.

Here are some metrics you can follow:

1 Like

Thanks Matthew! That answers my issue.
log waits and log writes will be enough for me to check if we are experiencing an abnormal bump in activity.
Thanks again.

1 Like