# Com\_XXXX vs Handler\_XXX

**URL:** <https://forums.percona.com/t/com-xxxx-vs-handler-xxx/564>\
**Category:** Other MySQL® Questions\
**Created:** [December 13, 2007, 9:16am UTC](https://forums.percona.com/t/com-xxxx-vs-handler-xxx/564 "2007-12-13T09:16:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lagaffe](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@lagaffe](https://forums.percona.com/u/lagaffe)\
**Post date:** [December 13, 2007, 9:16am UTC](https://forums.percona.com/t/com-xxxx-vs-handler-xxx/564/1 "2007-12-13T09:16:55Z")

</div>

Hello everybody.

I would like to know the differences between Com\_XXX and Handler\_XXX status variables.I tried some thing which give strange results and I really don’t understand why. For exemple, I thought that Com\_XXX count every requests, bad, good, results found into cache or not and Handler\_XXX only queries that goes into the engine.BUT :  
±---------------±------+  
| Variable\_name | Value |  
±---------------±------+  
| Com\_delete | 1909 |  
| Handler\_delete | 2175 |  
±---------------±------+

Why Com\_delete is smaller??? (it from MySQL 4.0)

On a mysql 5.0.45 :  
mysql\> SHOW STATUS LIKE ‘%\_delete’;  
±---------------±------+  
| Variable\_name | Value |  
±---------------±------+  
| Com\_delete | 0 |  
| Handler\_delete | 0 |  
±---------------±------+  
2 rows in set (0.00 sec)

mysql\> DELETE FROM Country;  
mysql\> SHOW STATUS LIKE ‘%\_delete’;  
±---------------±------+  
| Variable\_name | Value |  
±---------------±------+  
| Com\_delete | 2 |  
| Handler\_delete | 0 |  
±---------------±------+

Why my DELETE has not been through the engine (MyISAM in that case)?

---

<div class="post-metadata">

**Author:** ![jrabbit](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jrabbit](https://forums.percona.com/u/jrabbit)\
**Post date:** [December 19, 2007, 2:50pm UTC](https://forums.percona.com/t/com-xxxx-vs-handler-xxx/564/2 "2007-12-19T14:50:13Z")

</div>

Maybe because you are deleting all the rows it optimised it internally into a “truncate table” or similar implementation?

---

<div class="post-metadata">

**Author:** ![lagaffe](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@lagaffe](https://forums.percona.com/u/lagaffe)\
**Post date:** [December 21, 2007, 10:35am UTC](https://forums.percona.com/t/com-xxxx-vs-handler-xxx/564/3 "2007-12-21T10:35:37Z")

</div>

not really, the delete was on a part of the table and was the first sql query.

Moreover, the delete should normally always go through the datafile. I don’t see how it can delete row only working in memory.
