Run the show status command to check the number of SQL executions

You can run the show status command or run the mysqladmin -u root -p extended-status command

The show status command allows you to add two levels of statistical results

  • Session level: default statistics of current links
  • Global level: statistics since the database was started last time

Note that there are two types of parameters starting with Com_ and Innodb_ in the statistics obtained from show status.

Com_xxx represents the number of times each XXX statement is executed. We usually care about the number of times the SELECT, INSERT, UPDATE, and DELETE statements are executed, i.e

Com_select: indicates the number of times the select operation is performed. A query results in + 1. Com_insert: indicates the number of INSERT operations. For batch INSERT operations, only one is added. Com_update: indicates the number of times the UPDATE operation is performed. Com_delete: indicates the number of DELETE operations.Copy the code

The main arguments starting with Innodb_ are

Innodb_rows_read: The number of rows returned by a select query. Innodb_rows_inserted: Number of rows inserted by an INSERT operation. Innodb_rows_updated: Number of rows updated by the UPDATE operation. Innodb_rows_deleted: indicates the number of rows deleted by the DELETE operation.Copy the code

By counting the results of the above parameters, we can get a rough idea of whether the current database is update-oriented (including inserts and deletes) or query-oriented. The blog below summarizes almost all of the show Status parameters and serves as a reference manual.

Blog.csdn.net/ayay_870621…