Relationship between MySQL state variables handler_delete and com_delete (to old gold)

Source: Internet
Author: User

Original http://www.mysqlops.com/2011/02/10/mysql%E7%8A%B6%E6%80%81%E5%8F%98%E9%87%8F-handler_delete%E5%92%8Ccom_delete%E6%9C%89%E4%BB%80%E4%B9%88%E5%85%B3%E7%B3%BB%EF%BC%9F.html

 

 

Both are MySQL and a status variable in show status.
According to the MySQL official documentation:
Handler_delete:
The number of times that rows have been deleted from tables.
Number of deleted rows.
Com_delete:
The com_xxx statement counter variables indicate the number of times each XXX statement has been executed ./
The number of times the DELETE command is executed.
<! -More->
Let's test it:

(Root @ sns-ptst4 :) [test]> select * from T1;
+ -- + --- +
| Name | N1 |
+ -- + --- +
| AAA | null |
| BBB | null |
| CCC | null |
| AAA | AAAAA |
+ -- + --- +
4 rows in SET (0.00 Sec)

(Root @ sns-ptst4 :) [test]> show global status like '% Delete % ';
+ ------- + --- +
| Variable_name | value |
+ ------- + --- +
| Com_delete | 0 |
| Com_delete_multi | 0 |
| Handler_delete | 0 |
| Innodb_rows_deleted | 0 |
+ ------- + --- +
4 rows in SET (0.00 Sec)

(Root @ sns-ptst4 :) [test]> Delete from T1;
Query OK, 4 rows affected (0.00 Sec)

(Root @ sns-ptst4 :) [test]> commit;
Query OK, 0 rows affected (0.00 Sec)

(Root @ sns-ptst4 :) [test]> show global status like '% Delete % ';
+ ------- + --- +
| Variable_name | value |
+ ------- + --- +
| Com_delete | 1 |
| Com_delete_multi | 0 |
| Handler_delete | 4 |
| Innodb_rows_deleted | 4 |
+ ------- + --- +
4 rows in SET (0.00 Sec)

From the results of the two show statuses, they all match the official descriptions.

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.