Since MariaDB 5.2, a patch from Google, Percona, and other companies has been implemented, which permits you to view the user statistics, client statistics, index statistics (and usage), and table statistics.
You can activate it on the fly using the following command:
MariaDB [(none)]> SET GLOBAL userstat=1;
Alternatively, you can make it persistent in the MariaDB configuration (my.cnf) using the following code:
[mysqld]
userstat = 1
You now have access to the new FLUSH and SHOW commands:
MariaDB [(none)]> FLUSH TABLE_STATISTICSMariaDB [(none)]> FLUSH INDEX_STATISTICSMariaDB [(none)]> FLUSH USER_STATISTICSMariaDB [(none)]> FLUSH CLIENT_STATISTICSMariaDB [(none)]> SHOW CLIENT_STATISTICSMariaDB [(none)]> SHOW USER_STATISTICSMariaDB [(none)]> SHOW INDEX_STATISTICSMariaDB [(none)]> SHOW TABLE_STATISTICS
Here is an example of what the user statistics look like: