0

I have a table Doctor, which has 30 000 records. I was wondering, why does this simple SQL query:

SELECT * FROM ( SELECT * FROM Doctor ) AS tmp

take at least 5 minutes to execute in phpmyadmin (it is killed after 5 minutes of executing by default, but 5 minutes for this kind of query is way too long too)

However, if I do it with database City, which has roughly 3000 records, it takes about 3 minutes to load, but phpmyadmin said the query took 0.001 seconds..

I know these queries don't make sense and they can be simplified, but I needed to select from more complex derived table and found out that not even this simple query works.

Any ideas?

Thanks

Jurom
  • 1,691
  • 1
  • 11
  • 10
  • 1
    i think the problem is not located in mysql but in your php interpreter. showing 30000 lines of data could be to much data and exceeds the php memory limit. wath the apache error_log – niyou Dec 12 '13 at 09:59
  • It has no problem executing query `SELECT * FROM Doctor` neither showing even 100 000 lines of joined tables – Jurom Dec 12 '13 at 10:05
  • 1
    then take look here: http://stackoverflow.com/questions/8131562/simple-mysql-queries-taking-long-time-to-compute – niyou Dec 12 '13 at 10:10
  • It works fine through command line, thanks ! So the problem is with my phpmyadmin, but I can live with that.. will try reinstalling and other suggestions from the above mentioned links – Jurom Dec 12 '13 at 10:21

0 Answers0