I did add explain keyword in front of my query but had no idea how to use it for query optimization.
Output looks like : https://drive.google.com/file/d/0B070X_hyTgDbR195REY3Q0E3MVU/view?usp=sharing
I did add explain keyword in front of my query but had no idea how to use it for query optimization.
Output looks like : https://drive.google.com/file/d/0B070X_hyTgDbR195REY3Q0E3MVU/view?usp=sharing
First line -- a table scan (see NULLs and ALL)
2nd and 4th line -- an index scan ("Using index"), but rather costly since 10K rows needed.
What it does not tell you is whether some other index(es) would be more efficient. Nor does it tell you whether reformulating the query would help. Please provide us with the SELECT so we can help you there, plus tie more things to the EXPLAIN.
More links:
http://myxplain.net/
http://www.sitepoint.com/using-explain-to-write-better-mysql-queries/
EXPLAIN is mysql query to use it write like this
EXPLAIN SELECT * FROM table_name;
OR with where or other condition
EXPLAIN SELECT * FROM table_name WHERE id='value';