How can you do the fine tunning?

Answer Posted / subeeshbabu v

Fine tuning is mostly done for the SELECT statements.
Use the Keyword EXPLAIN in front Of your SELECT Statement.

eg: EXPLAIN SELECT t1.id, t2.id FROM table1 AS t1 INNER JOIN
TABLE2 AS t2 ON .....;
The result will be like this
+----+-------------+-----------+------+-----------------+-----------------+---------+-------+------+-------------+
| id | select_type | table | type | possible_keys |
key | key_len | ref | rows | Extra |
+----+-------------+-----------+------+-----------------+-----------------+---------+-------+------+-------------+
| 1 | SIMPLE | table1 | ref | t1 |
t1 | 4 | const | 2 | Using where |
+----+-------------+-----------+------+-----------------+-----------------+---------+-------+------+-------------+
1 row in set (0.00 sec)

if the "ref" column value is found to be ALL, then the two
tables must be joined properly. if the "Extra" gives values
like
Using temporary; Using filesort then the columns in the
JOIN conditions and WHERE clause must be indexed properly.
By doing this we can make our queries executing faster.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to delete a database from mysql server.

520


How do I create a mysql username and password?

498


What does mysql_fetch_assoc do?

520


What is required to create mysql database?

526


How many rows can mysql hold?

471






What is row?

571


What is delimiter in mysql trigger?

532


What are the applications required to support mysql?

496


What is mysqli_select_db?

523


How do I save in mysql?

493


What is mysql port?

564


How to create trigger in mysql phpmyadmin?

520


How do I start mysql in linux?

481


What is pdo in mysql?

515


How do I find users in mysql?

533