Show status like ' com_% ';
Com_select | 1 Number of times a select operation is performed, only one query accumulates 1
Com_insert | 0 the number of times the insert operation was performed, and for inserts that were bulk inserted, only one time
Com_update | 0 Number of update operations performed
Com_delete | 0 Number of Delete operations performed
The above parameters accumulate for all the table operations of the storage engine, the following parameters are only for the InnoDB storage engine, the accumulated algorithm is slightly different
Mysql> Show status like ' innodb_rows_% ';
+----------------------+-------+
| variable_name | Value |
+----------------------+-------+
| innodb_rows_deleted | 1 | The number of rows deleted by performing the dellete operation
| innodb_rows_inserted | 50 | Number of rows inserted to perform the insert operation
| Innodb_rows_read | 168 | Number of rows returned by the Select query
| innodb_rows_updated | 0 | Number of rows updated to perform updat operations
+----------------------+-------+
With the above parameters, it is easy to understand whether the current database application is to insert the update primarily or query operations, and the approximate scale of execution of various types of SQL
For transactional applications, where transaction commits and rollbacks can be understood through com_commit and Com_rollback, for databases with very frequent rollback operations, it may mean that there are problems with application authoring.
Learn the frequency of various SQL executions with the show status command