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).

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;

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.