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
What is the maximum connection pool size?
What is blob storage?
How to present a past time in hours, minutes and seconds?
How do I get a list of table names in mysql?
How can you find out the version of the installed mysql?
How do I view data in mysql workbench?
How do I automate a backup in mysql?
How to use count function in mysql?
What is a user defined variable?
Should I use pdo or mysqli?
How do you rename a table in mysql?
What is mysqli_free_result?
How important is to list the column names when doing an insert?
can you elaborate on blob and text in mysql? : Mysql dba
Why to use char instead of varchar in the database?