MySQL状态变量 Handler_delete和Com_delete有什么关系?

这两个都是MYSQL,SHOW STATUS里的一个状态变量.
根据MYSQL官方文档解释:
Handler_delete:
   The number of times that rows have been deleted from tables.
   DELETED行数.
com_delete:
   The Com_xxx statement counter variables indicate the number of times each xxx statement has been executed.\
   DELETE命令的执行次数.
<!–more–> 
下面我们来测试一下:

(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)

从两次SHOW STATUS的结果来看,都与官文描述是相符的.



本文转自 liang3391 51CTO博客,原文链接:http://blog.51cto.com/liang3391/824834

上一篇:教你使用超简单的视频播放器JiaoZiVideoPlayer


下一篇:难道调用ThreadPool.QueueUserWorkItem()的时候,真是必须调用Thread.Sleep(N)吗?