How to Determine Session Status in MySQL

In MySQL server we determine the physical/logical I/O with the help of a query. The MySQL server maintains many status variables that provideinformation about its operation.

mysql> FLUSH STATUS;         // -- In newer MySQLs, this clears the "SESSION" values //


mysql> SHOW SESSION STATUS LIKE 'Handler%';

img 1.gif

Here, we show a table already create in  my database.
mysql> SELECT * FROM person;

img 2.gif

mysql> SHOW SESSION STATUS LIKE 'Handler%';
                                                                                     
new.gif 


mysql> SHOW STATUS LIKE 'Up%';

img 4.gif


Alas, the InnoDB STATUSes are global. So we need to capture them before and after.
Worse yet, other queries will be bumping the values, too.

mysql> SHOW SESSION STATUS LIKE 'Innodb_buffer_pool%';

img 5.gif

mysql> SHOW STATUS LIKE 'Innodb_buffer_pool%';

img 6.gif

Resources 

Here are some useful related resources:

Up Next
    Ebook Download
    View all
    Learn
    View all