Re: Is there a solution to this?
Hello,
I've stumbled upon this problem today and after a few hours of searching, I found a solution. Sometimes, MySQL hangs when creating a tmp table because of it's data fetching and sorting algorithms. In my case, when doing a multiple join on 3 tables, the query would just freeze. The query worked perfectly till yesterday. After running optimize, repair, flush..., checking the source code, etc., nothing seemed to work, so I just run explain on the query. The result: when joining one of the tables, I saw 2 interesting things:
1. The type was ALL
2. The Extra field showd me an Using temporary clause
The point? Well, the table was not using any indexes, nor did it have a primary key and that's a big problem when issuing an order by, for example.
The solution: check if all your tables inside joins are using an index or primary key.
In my case, just removing the "order by" made everything ok and that's when it hit me - indexes are the key.
The cause of the problem: when migrating to a new version of mysql or running an import, sometimes, certain indexes or primary keys get lost (I think they are human errors, not MySQL ones).
P.S. I didn't have time to check all the posts in the thread, so if anyone already gave this solution, my bad :)
Subject
Views
Written By
Posted
27523
August 11, 2005 11:25AM
23635
August 12, 2005 09:07AM
18936
August 12, 2005 01:06PM
18412
August 22, 2005 09:46AM
16510
August 24, 2005 03:27PM
12965
August 24, 2005 04:05PM
13649
August 26, 2005 11:02AM
7433
August 26, 2005 11:05AM
6816
August 26, 2005 11:45AM
6595
August 26, 2005 05:46PM
6857
August 26, 2005 10:34PM
6468
August 25, 2005 01:08PM
5860
August 26, 2005 11:07AM
5663
August 27, 2005 09:09AM
5992
August 29, 2005 11:50AM
5907
August 29, 2005 12:04PM
5267
August 29, 2005 12:55PM
5156
August 29, 2005 05:26PM
5128
August 29, 2005 06:34PM
4757
August 29, 2005 08:40PM
4642
August 29, 2005 08:47PM
4507
August 29, 2005 09:00PM
4703
August 30, 2005 10:05AM
4584
August 30, 2005 10:18AM
5096
August 30, 2005 10:20AM
6108
August 29, 2005 08:53PM
4971
August 29, 2005 09:50PM
4810
August 29, 2005 10:01PM
5253
August 30, 2005 08:53AM
4664
August 30, 2005 11:22AM
5208
August 30, 2005 11:33AM
4876
August 30, 2005 11:59AM
24338
August 31, 2005 02:32PM
6506
August 31, 2005 02:49PM
5191
August 31, 2005 02:56PM
5046
August 31, 2005 03:06PM
8282
December 07, 2006 10:30AM
4988
August 31, 2005 03:10PM
4857
August 31, 2005 03:32PM
17700
August 31, 2005 07:15PM
5103
September 01, 2005 03:05AM
7818
September 15, 2005 04:31PM
5541
September 01, 2005 04:39AM
4444
September 08, 2005 09:53AM
4803
September 08, 2005 11:25AM
4581
September 26, 2005 11:52AM
4493
September 26, 2005 12:13PM
4422
September 27, 2005 09:55AM
4205
September 27, 2005 10:18AM
4103
September 28, 2005 10:29AM
4248
September 28, 2005 10:34AM
4421
September 28, 2005 10:52AM
4884
September 28, 2005 10:58AM
9659
September 23, 2005 01:56AM
4946
September 23, 2005 07:11AM
4920
October 05, 2005 04:58AM
5161
October 05, 2005 04:52PM
6130
October 05, 2005 11:49PM
5389
October 06, 2005 01:34AM
6703
October 06, 2005 04:57PM
4637
December 13, 2005 10:28AM
4622
December 13, 2005 10:34AM
4531
November 17, 2005 09:39AM
4893
January 08, 2007 12:12PM
4761
December 12, 2005 02:13PM
4605
December 14, 2005 11:43PM
4202
December 15, 2005 08:37AM
4272
December 15, 2005 11:18AM
4186
December 15, 2005 11:27AM
4308
December 15, 2005 11:32AM
4058
December 15, 2005 11:43AM
4020
December 15, 2005 11:43AM
4186
December 15, 2005 11:48AM
4077
December 15, 2005 11:51AM
4472
December 15, 2005 02:14PM
4122
December 15, 2005 02:18PM
3993
December 15, 2005 02:27PM
4498
December 15, 2005 02:43PM
4042
December 15, 2005 08:46AM
5026
January 26, 2006 12:38PM
4151
January 26, 2006 01:48PM
4232
January 26, 2006 01:48PM
4014
January 26, 2006 01:52PM
4159
January 27, 2006 04:46PM
4038
January 29, 2006 11:21AM
4376
January 30, 2006 09:42AM
4414
February 27, 2006 02:17PM
4092
February 27, 2006 02:23PM
4326
March 05, 2006 04:56AM
4142
March 06, 2006 08:09AM
4111
April 05, 2006 01:03PM
4288
September 27, 2006 08:43AM
4246
November 19, 2006 04:42AM
4398
December 14, 2006 05:45PM
4217
February 01, 2007 04:40AM
4881
November 11, 2007 01:24PM
5094
December 20, 2007 10:40AM
6528
January 21, 2008 10:14AM
5868
January 21, 2008 10:53AM
5328
May 19, 2008 09:41AM
5539
February 05, 2008 10:27AM
Re: Is there a solution to this?
6081
March 12, 2008 08:37AM
5400
May 19, 2008 03:02AM
6140
November 14, 2008 12:31AM
7149
March 06, 2009 03:36PM