Jump to content

Long query creates temp table in phpMyAdmin


johnsmith153

Recommended Posts

I executed a SELECT query in phpMyAdmin which took a long time (lots of records etc.)

 

In the 'processes' area it showed that it was 'creating a temporary table on disk'.

 

When that completed, nothing happened. Where would the temp table be and how can I see the results of the query?

 

I didn't want a temp table and my query was a simple SELECT with a few joins etc. (execution time being the only complexity).

Link to comment
Share on other sites

A temp table is used internally by the database engine, it is not something you can query (unless of course you did a SELECT INTO TEMPORARY TABLE command). The results should have been displayed. It could be that the front-end timed out and did not get the results.

 

Try running an EXPLAIN on the query. Then post the query itself and the results of the EXPLAIN command. You may need to post your table structures as well.

 

There are several possible reasons for the problem, most likely:

1) you left out a JOIN and generated a Cartesian product; OR

2) you need to define indexes on fields that are being joined or used in conditionals;

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.