Learn the frequency of various SQL executions with the show status command

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.