Execution time of a mysql query, slow in php than phpmyadmin . How I can overcome this -


I was running a query in phpmyadmin, it takes approximately 0.0012 seconds to execute.

Show rows 0 - 29 (727,934 total, query taken 0.0012 seconds)

may be due to the default limit in phpmyadmin but it is the total of the line The number is counted.

But in php, I need the total number of lines. I was running the query without any limitation that takes 6-8 seconds to execute the query. / P>

They have any way to solve this problem.

I have such a problem and in my case this was due to the fact that I Was not using So, as long as I wanted to query the index field with my varChar type varichar, I have incorrectly prepared the query in such a way that I have interrogated it and with the int parameter. As a result the index is not being used, but a full table is being scanned. For example I did:

  SELECT * from table WHERE Indexfield = 015523;  

When I was supposed to do the following:

  SELECT * from table WHERE Indexfield = '015523';  

Here's some other insight on this issue:


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -