MySQL Forums
Forum List  »  Performance

Re: Is there a solution to this?
Posted by: Robert Freeland
Date: November 14, 2008 12:31AM

Not to bash MySQL -- because it really is a nice database for being FREE -- but this is the kind of thing that puts MySQL in a bad light relative to "real" databases like Oracle or even SQL Server.

If I issue a query against a database, it should either (a) do the work and give me the answer, or (b) throw an error. It should NOT hang indefinitely under ANY circumstances. Nor should it take DAYS to finish a relatively simple query. The fact that this thread was created THREE YEARS AGO is pretty damning. This should be fixed by now.

Just to forestall any comments to the affect, "Well, if you just turn this dial so, and then set this switch however, then it won't hang," the database shouldn't hang regardless of how badly I maul my setup parameters. Do you think I ever have to worry about this kind of thing with SQL Server? Never.

For those of you looking for some hint as to what's going on, here's a little bit of help:

(1) SHOW PROCESSLIST will tell you at a very high level what the process is actually doing. But if you've found this thread, you know that already.

(2) On Windows Server, the temporary table is being written to the C:\Windows\Temp folder, with a name like "#sql_*.MYD". If you're patient, you can watch just how S-L-O-W-L-Y MySQL writes this table. I have no idea what kind of algorithm could possibly take this long.

For instance, I have a query that's been running for 3 hours and has only managed to write 45MB to the temporary table (and no indexes yet). I can copy the entire temporary table in 15 seconds, so the process definitely isn't I/O bound. The process is using almost ZERO CPU, so it's definitely not CPU bound. I guess the process must be memory bound, but MySQL is using a GIG of RAM, so it could have built that entire result table in memory without any problem. The performance really is pretty sad.

In the realm of workarounds, we've had decent success breaking the job into smaller pieces and then running them all sequentially. Of course, you have no way of knowing when you'll need to do this until you've tried the full query first and seen it hang. Sad, sad, sad.



Edited 1 time(s). Last edit at 11/14/2008 12:35AM by Robert Freeland.

Options: ReplyQuote


Subject
Views
Written By
Posted
8306
December 07, 2006 10:30AM
9678
September 23, 2005 01:56AM
4940
October 05, 2005 04:58AM
6151
October 05, 2005 11:49PM
5406
October 06, 2005 01:34AM
6722
October 06, 2005 04:57PM
6545
January 21, 2008 10:14AM
5882
January 21, 2008 10:53AM
5355
May 19, 2008 09:41AM
5556
February 05, 2008 10:27AM
6103
March 12, 2008 08:37AM
Re: Is there a solution to this?
6156
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.