MySQL Forums
Forum List  »  Performance

Has anyone found a Viable Solution?
Posted by: Fabian Osterfeld
Date: September 23, 2005 01:56AM

Has anyone found a Viable Solution?

I have the same problem, sometimes a query will hang the with the status: “Copying to tmp table”.
What I have found is that it does not have much to do with the OS or the hardware configuration and also happens when the offending query is the ONLY query run on the server. Also, I’m not concerned about slow performance, but simply queries that are completely hung with this message, queries that can and should take 20 seconds hanging for day, weeks and probably years if I would let them.

This occurrence of such “hung” queries if not acceptable for any enterprise level database engine, I expect an error and termination of a query if some resource is exhausted and in the same way be able to trace such problems back to resource exhaustion, but I can’t, the problem occurs even if the server is otherwise idle and has apparently lots of free memory, cpu cycles and hard drive space.

Doesn’t this mean it is a bug or poorly written code that is unable to gracefully handle a deadlock for some resource and shouldn’t someone have fixed it by now? If not then there has to be a miss configuration and can be resolved, but what is it?

What I consider Viable Solutions:
Configuration Change or Program Update that will permanently resolve this issue
For example, disabling support for tmp tables, I don’t care if it takes 10x as long, if it DOESN’T HANG it is very acceptable.

What I do NOT consider as a viable solution:
Scripts that detect and terminate such hung queries (once my query hangs is is about 95% likely to hang again on the next attempt until the server has restarted, and no, flushing tables doesn’t help a thing)
Random changing of variables in the hope of staving off the occurrence for some time
Blaming it on OS/Hardware (I have seen it in too many different hardware/os’s)
Blaming it on load (happens when the query /user/thread is the ONLY one)
and any other solution that does not stop this from happening.

Currently I am running on a MySQL 4.1, installed and configured using the windows installer and set to “stand alone server” (max server resources) & "transaction type" (InnoDB) & "olap" (max 20 conn), no other configuration changes have occurred.
The OS is Windows 2003 Server x64 (I know, running Linux AMD64 MySql would be better instead of the 32bit window version, but it has not effect on this problem)
The Server is a Dual Opteron box, 4GB memory, two separate RAID controllers, one for the system and applications including MySQL binaries, and the other purely for MySql’s data files. The table I am running the query on has bout 27 fields, (all constant sizes, not text fields of any kind) and about 7.6 million records. With a simple but large query that ammounts to a avg/sum/std/max/min where id in subquery group by. All used tables are stored using InnoDB.
I have had trouble with teh same query on a Xenon server too.

Please let me know if you had this problem and somehow resolved it permanently/reliably.




Edited 2 time(s). Last edit at 10/17/2005 05:27AM by Frank Osterberg.

Options: ReplyQuote


Subject
Views
Written By
Posted
8196
December 07, 2006 10:30AM
Has anyone found a Viable Solution?
9574
September 23, 2005 01:56AM
4840
October 05, 2005 04:58AM
6030
October 05, 2005 11:49PM
5316
October 06, 2005 01:34AM
6610
October 06, 2005 04:57PM
6425
January 21, 2008 10:14AM
5783
January 21, 2008 10:53AM
5241
May 19, 2008 09:41AM
5450
February 05, 2008 10:27AM
5999
March 12, 2008 08:37AM
6059
November 14, 2008 12:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.