Go Back   HTMLCenter Web Development Forums > Web Design and Development > Databases

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-14-2008, 03:55 PM
Registered User
 
Join Date: Aug 2007
Posts: 6
Copying to tmp table

When I run the following:

show processlist

I've been getting some entires of: Copying to tmp table

They don't hang like most of the people have when I do a search in google for the problem. What I want to know is, what does this mean? I just started noticing this and the load on the server seems to be higher than normal.

Thank you
Reply With Quote

  #2 (permalink)  
Old 04-14-2008, 04:17 PM
Deadeye's Avatar
Moderator
 
Join Date: Aug 2005
Location: San Diego, CA
Posts: 253
Send a message via MSN to Deadeye
were going to need more info then just what you provided.

What database are you running and what are you trying to do when it hangs?

Wesley
__________________
Don't forget to rate me A+++++++++++++++++!!!!!111one for the service you have received.
Reply With Quote
  #3 (permalink)  
Old 04-14-2008, 08:08 PM
zoul's Avatar
Moderator
 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 65
Send a message via AIM to zoul
I believe, if I read your message correctly, that you stated "Its not hanging" ... and your simply asking "what is this" ...

Regardless of your DBMS, "copying to tmp table" processes usually mean that another query is 'staging' data ... for example, when performing join queries ... some DBMS's will place the results in a TEMP table prior to returning them ... or toss a large set of data into a TEMP table so that it can then query the larger set to retrieve a smaller set ... almost always having to deal with joins or sub-queries where more then one 'table' is being accessed ...

"Copying to tmp tables" is usually not something you need concern yourself with, however, if it's slowing you down... then perhaps you need to re-evaluate some of your queries and determine if they can be 'fine tuned' ... performance tuning usually weeds out a lot of unnecessary operations ...
__________________
-- David Higgins
http://www.fragmentedcode.com
http://www.zoulcreations.com
Reply With Quote
  #4 (permalink)  
Old 04-14-2008, 08:15 PM
zoul's Avatar
Moderator
 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 65
Send a message via AIM to zoul
as a follow up ... RE: 'the load on the server seems to be higher than normal.' ...

this is common, especially on databases that gradually grow ... at any rate of speed and size. The more data in the system, the slower it will run ... fairly common, performance tuning is again the best way to resolve this issue .. and sometimes, a query that performed really well with little data will perform horribly with lots of data ... the inverse is also sometimes true where a query that performs well with lots of data, performs poorly with little data (in comparison, heh)
__________________
-- David Higgins
http://www.fragmentedcode.com
http://www.zoulcreations.com
Reply With Quote
  #5 (permalink)  
Old 04-15-2008, 09:53 AM
Registered User
 
Join Date: Aug 2007
Posts: 6
thanks for the responses. It is a Mysql 5 db. I'm not doing any subqueries in it.

I ran explain and it appears that it only does this when I use either group by or order by on the table. How would I optimize this better? I do have indexes on the fields being used in both the group by and order by for the table in question.
Reply With Quote
  #6 (permalink)  
Old 04-15-2008, 10:17 AM
zoul's Avatar
Moderator
 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 65
Send a message via AIM to zoul
we'd need to see the table schema and the query your using to even begin to help with that ... and, as I was trying to say ... it's possible that there is no issue, and it's just a matter of 'lots of data' ...
__________________
-- David Higgins
http://www.fragmentedcode.com
http://www.zoulcreations.com
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem creating table in an existing db gilgalbiblewhee Programming and Scripting 1 12-19-2007 06:40 PM
Ordered, numbered table columns? curtiss Programming and Scripting 2 12-14-2007 02:07 PM
Scrolling in a table nyrunner Programming and Scripting 3 04-10-2006 09:23 AM
Table Alignment Crewman Programming and Scripting 1 04-08-2006 08:54 AM


All times are GMT -5. The time now is 08:44 PM.

 
KickApps
Clicky Web Analytics


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter