Same MySQL query takes 0.3 sec in MyPHPAdmin, 7.9 sec in PHP — Why?

This could be because phpMyAdmin adds a limit clause behind the screen due to the fact that it's paginating the results.

This could be true, to test you could echo out your SQL from your PHP script and run it in the query tool on phpMyAdmin. – Ben Everard Nov 18 '09 at 10:52 You're right Nicky. I was so fixated on the query I was entering into the SQL pane that I didn't think about the "limit 30" that MyPHPAdmin adds to each query.My test page gives the same results as MyPHPAdmin when I add the limit clause.

– Andrew Swift Nov 18 '09 at 10:56.

When you run your sql query you get all the records which suits you criteria. But if you don't show all all of them in your page get records how many you want to show at your web page. I mean page them.

If it is on a linux box, you can try to query the serveur using the tool "mysql" if you want to check.

If I run the query via MyPHPAdmin, it takes 0.3 seconds to run, but in my php page on the same host it consistently takes about 8 seconds. Can anyone explain why my program runs the same query so much slower than MyPHPAdmin? Update 1 I tested the query outside of any other programming -- I created a simple test.

Php page that contained only the mysql connect info and the query in question. So a priori it's not some other aspect of the site programming that's causing the delay. Update 2 The actual time that it takes to load the page is the same for MyPHPAdmin and for my test page.

The difference may be due to the way that MyPHPAdmin calculates the query time. In any case, if the query takes only 0.3 seconds to process, where does the rest of the delay come from?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions