# Slow Create Temporary Table

**URL:** <https://forums.percona.com/t/slow-create-temporary-table/3452>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [May 7, 2014, 12:54am UTC](https://forums.percona.com/t/slow-create-temporary-table/3452 "2014-05-07T00:54:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pathet](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pathet](https://forums.percona.com/u/pathet)\
**Post date:** [May 7, 2014, 12:54am UTC](https://forums.percona.com/t/slow-create-temporary-table/3452/1 "2014-05-07T00:54:54Z")

</div>

Hello everybody,

we have a performance issue with “Create Temporary Table” querys.  
“CREATE TEMPORARY TABLE tempdata.SPHINXV36clal32eo8oaj8n3mjv1o7ukjc4 (SPHID INTEGER(12) NOT NULL PRIMARY KEY, SORT INTEGER(12))”

The problem is not permanently, but there are about 10 slow querys an hour.

We have a Percona XtraDB Cluster with 3 nodes.

±------------------------±------

Many tmp tables goes to disk, so I increase the tmp\_table\_size and the max\_heap\_table\_size from 256M to 512M, but it takes no effect.

Maybe someone have a idea ?

Thanks in advanced.

Regards  
Patrick

---

<div class="post-metadata">

**Author:** ![mirfan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mirfan/32/16890_2.png) [@mirfan](https://forums.percona.com/u/mirfan)\
**Post date:** [May 14, 2014, 12:51am UTC](https://forums.percona.com/t/slow-create-temporary-table/3452/2 "2014-05-14T00:51:41Z")

</div>

created\_tmp\_disk\_tables is quite high which suggests your queries requires tuning. I would recommend to enable slow query log in peak time with long\_query\_time=0 for some specific time 1-2 hour should be enough and analyze those queries with the help of [pt-query-digest](http://www.percona.com/doc/percona-toolkit/2.2/pt-query-digest.html) tool from [percona-toolkit](http://www.percona.com/software/percona-toolkit). I would suggest to read my post here for analysis of slow query log [url][http://www.mysqlperformanceblog.com/2014/03/14/tools-and-tips-for-analysis-of-mysqls-slow-query-log/[/url]](http://www.mysqlperformanceblog.com/2014/03/14/tools-and-tips-for-analysis-of-mysqls-slow-query-log/%5B/url%5D)  
I foresee this will help to boost overall cluster performance after fixing the SQL
