You need to look at the GROUP BY clause If all the columns from a GROUP BY clause are not indexed or if the columns in the GROUP BY clause are from different tables, MySQL will use the temp table.
Please send your query to the MySQL List and the structure of all tables in the query ----- Original Message ----- From: Francis <[EMAIL PROTECTED]> To: MySQL General <mysql@lists.mysql.com> Sent: Monday, November 6, 2006 8:50:40 AM GMT-0500 US/Eastern Subject: " Copy to tmp table " optimize Hi list, An others question, I am working on projet and i made some test. I use large databases, some table go up to 1.8g. The problem we have is wend I try to select data in table whit a group by function and I got " Copy to tmp table " This function take a long time to execute. I check on my server for the cpu usage and no hang up, no hang up on hardrive, the only hang up I have is on memory. 1 Question, the " copy to tmp table " function can optimize to get faster ? 2 Question, what is the max table I can create in databses ? because, the way I found to optimize " copy to tmp table " is by spliting the data in my table in multiple tables to lower the size...But if I do this way, the table counts on my database can go up to 600 tables :S I don't think is a good way to do this. Ty for your help and sorry for my english... Francis ! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]