# "freeing items"

**URL:** https://forums.percona.com/t/freeing-items/1053
**Category:** Other MySQL® Questions
**Created:** [January 7, 2009, 5:09pm UTC](https://forums.percona.com/t/freeing-items/1053 "2009-01-07T17:09:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Zirafarafa](https://avatars.discourse-cdn.com/v4/letter/z/c37758/32.png) [@Zirafarafa](https://forums.percona.com/u/Zirafarafa)
#### Post date: [January 7, 2009, 5:09pm UTC](https://forums.percona.com/t/freeing-items/1053/1 "2009-01-07T17:09:58Z")

</div>

Hi

My query which contributes the highest to server load is one which runs something like the following:

UPDATE VgsmEngines SET routingReady=true WHERE channel=‘SIP/jhb-ecncore-vgsm20/9\*’

A profile shows:

mysql\> show profile for query 6;±---------------------±---------+| Status | Duration |±---------------------±---------+| starting | 0.000085 || checking permissions | 0.000008 || Opening tables | 0.000014 || System lock | 0.000007 || Table lock | 0.000007 || init | 0.000065 || Updating | 0.000081 || end | 0.000017 || query end | 0.000005 || freeing items | 0.139479 || logging slow query | 0.000013 || logging slow query | 0.000017 || cleaning up | 0.000005 |±---------------------±---------+13 rows in set (0.00 sec)

So, most of the time is in ‘freeing items’

I can’t find much info about this state, apart from :

| [B]Quote:[/B] |
| 

freeing items  
The thread has executed a command. This state is usually followed by cleaning up.

 |

What can I do to improve the execution time of these queries. What extra info would be helpful in diagnosing this issue?

Thanks  
Chris

---

<div class="post-metadata">

### Author: ![MarkRose](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@MarkRose](https://forums.percona.com/u/MarkRose)
#### Post date: [March 21, 2009, 6:51pm UTC](https://forums.percona.com/t/freeing-items/1053/2 "2009-03-21T18:51:08Z")

</div>

I’m not positive, but I believe that has to do with invalidating queries in the query cache that reference the table VgsmEngines.

You may wish to disable the query cache by default by setting query\_cache\_type=2, and changing your SELECTs to SELECT SQL\_CACHE for the queries you wish to cache (ones that reference tables that rarely change).

[http://dev.mysql.com/doc/refman/5.1/en/server-system-variabl](http://dev.mysql.com/doc/refman/5.1/en/server-system-variabl) es.html#sysvar\_query\_cache\_type

---

<div class="post-metadata">

### Author: ![natethelen](https://avatars.discourse-cdn.com/v4/letter/n/ac8455/32.png) [@natethelen](https://forums.percona.com/u/natethelen)
#### Post date: [June 18, 2010, 3:16pm UTC](https://forums.percona.com/t/freeing-items/1053/3 "2010-06-18T15:16:56Z")

</div>

We are having the same problem. Query Cache is off, IO is 10% of capacity, is the master in a master-slave replication setup. Anyone know what could cause this?
