This tables are created on disk when a query needs a tmp table bigger
than tmp_table_size and max_heap_table_size. The common situations
when a tmp table is needed are[1]:
*If there is an ORDER BY clause and a different GROUP BY clause, or if
the ORDER BY or GROUP BY contains columns from tables other than the
first table in the join queue, a temporary table is created.
*DISTINCT combined with ORDER BY may require a temporary table.
*If you use the SQL_SMALL_RESULT option, MySQL uses an in-memory
temporary table, unless the query also contains elements (described
later) that require on-disk storage.
You can lookup in your django code where this conditions are met or
you can just can increase the tmp_table_size and max_heap_table_size
thresholds on mysql server. :)
[1] http://dev.mysql.com/doc/refman/5.1/en/internal-temporary-tables.html
br
--
Marc