What is the difference between Com_xxx and handler_xxx?
Question
Initially my com_delete
variable and handler_xxx
variables are nil.
| Com_delete | 0 |+
| Handler_delete | 0 |
+----------------+-------+
then I issued a delete query delete from gt where i=1;
when I checked both the variables it changed to 1.
My Question is what these variables differentiate ? I'm using MySQL 5.6
Solution
Com_delete is number of times a user sent DELETE command to MySQL.
Handler_delete is number of times MySQL server sent delete handler to a storage engine via internal API
To illustrate the difference here's an example:
mysql> delete from t1 where id < 100;
Query OK, 88 rows affected (0.00 sec)
mysql> show status like 'Com_delete';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Com_delete | 1 |
+---------------+-------+
1 row in set (0.00 sec)
mysql> show status like 'Handler_delete';
+----------------+-------+
| Variable_name | Value |
+----------------+-------+
| Handler_delete | 88 |
+----------------+-------+
1 row in set (0.00 sec)
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange