# Created\_tmp\_disk\_tables very high

**URL:** <https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227>\
**Category:** Other MySQL® Questions\
**Created:** [July 30, 2009, 4:26pm UTC](https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227 "2009-07-30T16:26:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkeyser](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@tkeyser](https://forums.percona.com/u/tkeyser)\
**Post date:** [July 30, 2009, 4:26pm UTC](https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227/1 "2009-07-30T16:26:50Z")

</div>

This MySQL server has been running for 0 days, 1 hours, 59 minutes and 42 seconds.

Query statistics: Since its startup, 246,498 queries have been sent to the server.

I dont understand why my tmp tables on disk would be so high with a 1G tmp\_table\_size and Max\_heap\_table\_size

I am running CentOS5.3 and 5.0.82 percona b16… I have 12GB of ram and dual 3.04G CPU. Just upgraded to be able to change my temp directive.

Created\_tmp\_disk\_tables 34 k  
Created\_tmp\_files 5  
Created\_tmp\_tables 49 k

tmp\_table\_size = 1G  
max\_heap\_table\_size = 1G

Any ideas?

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [July 30, 2009, 4:50pm UTC](https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227/2 "2009-07-30T16:50:59Z")

</div>

Text columns cannot be sorted in memory. So improve your indices.

---

<div class="post-metadata">

**Author:** ![tkeyser](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@tkeyser](https://forums.percona.com/u/tkeyser)\
**Post date:** [July 30, 2009, 5:13pm UTC](https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227/3 "2009-07-30T17:13:21Z")

</div>

Im running wordpress 2.7 on all the domains… Not sure if I can improve the indices?

Sounds like its more then just the index since you say the text columns can not be sorted in memory. Almost every query includes a text column.

I have created a tmpfs for the tmp data area I expect that is helping by allowing the tmp files to be created in ram disk.

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [July 30, 2009, 5:20pm UTC](https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227/4 "2009-07-30T17:20:54Z")

</div>

Wordpress has very bad database utilization. The indices are bad, the queries are bad. Wordpress wasn’t ever designed to handle large blogs.

I have put some efforts in optimizations of Wordpress, you should update to the most recent version. That helps only slightly. You should use supercache or a similar plug-in, and in the long-term look out for better blogging software if you intend to grow.

---

<div class="post-metadata">

**Author:** ![tkeyser](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@tkeyser](https://forums.percona.com/u/tkeyser)\
**Post date:** [July 30, 2009, 6:21pm UTC](https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227/5 "2009-07-30T18:21:40Z")

</div>

Well, we have already grown to 1400 blogs… that’s the problem… Backend posting is taking forever. (

I have moved all SQL to a dedicated server and innobd only databases.

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [July 31, 2009, 3:58am UTC](https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227/6 "2009-07-31T03:58:19Z")

</div>

Then reduce the size of those in-memory tables to default values (couple of meg each iirc) and increase your innodb buffer pool. And take a look at other innodb tweaking parameters. That should help some, but you have got to live with on disk sorting for Wordpress.

And remove all Wordpress plug-ins or make sure you can optimize them yourself. Most are bad as well.

---

<div class="post-metadata">

**Author:** ![tkeyser](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@tkeyser](https://forums.percona.com/u/tkeyser)\
**Post date:** [July 31, 2009, 12:19pm UTC](https://forums.percona.com/t/created-tmp-disk-tables-very-high/1227/7 "2009-07-31T12:19:10Z")

</div>

Thanks for the feedback

You just reconfirmed where my mind was going on all this.

I am not going to waste the 1G on temp tables in ram if they are going to disk anyway. I am also going to put in a second MySQL server and split the load, besides the other items you suggested.

Long term I need to find another blog that manages data and queries better. Its going to be a bear to move everything, but the problem is only going to get worse. For now I just need to throw more hardware at the problem.
