Information Schema USER_STATISTICS Table

MariaDB 5.2.0

The USER_STATISTICS table was introduced in MariaDB 5.2.0 as part of the User Statistics feature.

MariaDB starting with 10.1.1

The TOTAL_SSL_CONNECTIONS and MAX_STATEMENT_TIME_EXCEEDED columns were added in MariaDB 10.1.1

The Information Schema USER_STATISTICS table holds statistics about user activity. This is part of the User Statistics feature, which is not enabled by default.

You can use this table to find out such things as which user is causing the most load and which users are being abusive. You can also use this table to measure how close to capacity the server may be.

It contains the following columns:

USERvarchar(48)The username. The value '#mysql_system_user#' appears when there is no username (such as for the slave SQL thread).
TOTAL_CONNECTIONSint(21)The number of connections created for this user.
CONCURRENT_CONNECTIONSint(21)The number of concurrent connections for this user.
CONNECTED_TIMEint(21)The cumulative number of seconds elapsed while there were connections from this user.
BUSY_TIMEdoubleThe cumulative number of seconds there was activity on connections from this user.
CPU_TIMEdoubleThe cumulative CPU time elapsed while servicing this user's connections.
BYTES_RECEIVEDint(21)The number of bytes received from this user's connections.
BYTES_SENTint(21)The number of bytes sent to this user's connections.
BINLOG_BYTES_WRITTENint(21)The number of bytes written to the binary log from this user's connections.
ROWS_READint(21)The number of rows read by this user's connections.
ROWS_SENTint(21)The number of rows sent by this user's connections.
ROWS_DELETEDint(21)The number of rows deleted by this user's connections.
ROWS_INSERTEDint(21)The number of rows inserted by this user's connections.
ROWS_UPDATEDint(21)The number of rows updated by this user's connections.
SELECT_COMMANDSint(21)The number of SELECT commands executed from this user's connections.
UPDATE_COMMANDSint(21)The number of UPDATE commands executed from this user's connections.
OTHER_COMMANDSint(21)The number of other commands executed from this user's connections.
COMMIT_TRANSACTIONSint(21)The number of COMMIT commands issued by this user's connections.
ROLLBACK_TRANSACTIONSint(21)The number of ROLLBACK commands issued by this user's connections.
DENIED_CONNECTIONSint(21)The number of connections denied to this user.
LOST_CONNECTIONSint(21)The number of this user's connections that were terminated uncleanly.
ACCESS_DENIEDint(21)The number of times this user's connections issued commands that were denied.
EMPTY_QUERIESint(21)The number of times this user's connections sent empty queries to the server.
TOTAL_SSL_CONNECTIONSint(21)The number of TLS connections created for this user. (>= MariaDB 10.1.1)
MAX_STATEMENT_TIME_EXCEEDEDint(21)The number of times a statement was aborted, because it was executed longer than its MAX_STATEMENT_TIME threshold. (>= MariaDB 10.1.1)


SELECT * FROM information_schema.USER_STATISTICS\G
*************************** 1. row ***************************
                  USER: root
        CONNECTED_TIME: 297
             BUSY_TIME: 0.001725
              CPU_TIME: 0.001982
        BYTES_RECEIVED: 388
            BYTES_SENT: 2327
             ROWS_READ: 0
             ROWS_SENT: 12
          ROWS_DELETED: 0
         ROWS_INSERTED: 13
          ROWS_UPDATED: 0
         ACCESS_DENIED: 0
         EMPTY_QUERIES: 1


Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.