Does MySQL use its index metadata to optimize COUNT(*) queries?
It has to scan the whole index. Look at the output of:
SHOW INDEX FROM user_actions;

You will see the approximate cardinality of each index. The approximation is based on a few random dives into the index, not an exhaustively checked exact number. The approximation is sufficient for balancing.