Portal Home > Knowledgebase > Articles Database > fixing "Copying to tmp table"


fixing "Copying to tmp table"




Posted by goooh, 07-12-2009, 03:13 PM
I've noticed I've been getting a lot of "Copying to tmp table" and from a google search this is bad. Any idea on how I can fix this in my shared hosting environment? Running MySQL 5.0.81 on CPanel.

Posted by mikkie, 07-12-2009, 10:02 PM
have you tried increasing values?

Posted by eeg3, 07-12-2009, 10:50 PM
You'll need to find the SQL statements that are causing the "Copying to tmp table". For example, * ORDER BY RAND() is an example of a query that causes this behavior, and the way to get around it is to find different queries or methods to replace it with. You can find out if a query will cause it by using 'EXPLAIN' on the statement. "Copying to tmp table" is not too horrible if only a few queries cause it, but writing to disk will always be slower than most alternatives.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
SATA Drives (Views: 550)