Profiling Queries with SHOW STATUS
The combination of FLUSH STATUS and SHOW SESSSION STATUS can be used to see what happens while MySQL executes a query. First, run FLUSH STATUS to reset session status variables to zero.
mysql> FLUSH STATUS;
mysql> SELECT COUNT(*) FROM TABLE;




