MySQL Forums
Forum List  »  Performance

Re: Hanging on copying to tmp table
Posted by: Rick James
Date: April 24, 2012 10:16AM

(Thanks for the detailed info.)

> Sometimes it hangs on "copying to tmp table", and also "sending data", but mostly on "copying...".
> It does not happen everyday, and I have not found a way to recreate it, so I cannot explain why it happens.

You are saying it will be fast for awhile, then slow for awhile? If so, that sounds like the "8 random dives" screwing up sometimes.

Or (more likely), SQL_CACHE is part of the answer. Right after making _any_ change to the table, the query is slow. After that, it stays fast. "Fast" would be because of SQL_CACHE and the Query Cache.

When it runs fast, does the EXPLAIN show that it is using `indx_testcase_lft`?
If so, give this change a try:

> FROM `test_testcase` AS `node`, `test_testcase` AS `parent`
-->
FROM `test_testcase` AS `node` USE INDEX(indx_testcase_lft),
`test_testcase` AS `parent`

If that does not work, change USE to FORCE. If that still does not work, come back, and I will scratch my head some more.

> 'innodb_buffer_pool_size', '2621440000'
I assume you have at least 4GB of RAM.

It is usually "wrong" to do SELECT a,b,c ... GROUP BY a. You can't predict which b,c you will get.

Options: ReplyQuote


Subject
Views
Written By
Posted
6963
April 23, 2012 06:55AM
Re: Hanging on copying to tmp table
3396
April 24, 2012 10:16AM
2970
April 24, 2012 02:44PM
2285
April 25, 2012 01:08PM
2607
April 25, 2012 08:43PM
2444
April 26, 2012 12:35AM
2794
April 26, 2012 02:17AM
1961
April 27, 2012 07:02AM
2157
April 28, 2012 01:37PM
2256
April 28, 2012 02:00PM


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.