0

I got a job maintaining a high traffic webapp that uses MySQL. I'm using MySQLTuner, a Perl script that makes recommendations to improve MySQL performance. Recently I've been getting the following error from MySQLTuner:

[!!] Temporary tables created on disk: 49% (50M on disk / 102M total)

How can I find out which queries are creating temporary tables on disk?

Matteo
  • 37,680
  • 11
  • 100
  • 115
khizar ansari
  • 1,476
  • 2
  • 18
  • 29
  • http://search.cpan.org/~timb/DBI/DBI.pm#TRACING – mpapec Feb 11 '14 at 20:10
  • Not for nothing, but tables that do not vaporize or at least auto-purge their data when their session closes are hard pressed to be called temporary. – Len Jaffe Feb 12 '14 at 19:48

1 Answers1

0

Search your perl code for CREATE TEMPORARY TABLE. For searching stored procs and stuff on the backend (if you're using TOAD) you can do Tools->Object Search then search for that same string. Or dump the DB and search the dump text file for that string.

gfrobenius
  • 3,987
  • 8
  • 34
  • 66