Databases Reference
In-Depth Information
We can see that the
EXPLAIN
command has been passed to MySQL, telling us
that the
key
used is
author_language.
Thus, we know that this index will be used
for this type of query. If this index had not existed, the result would have been
quite different.
Here,
key
(
NULL
) and the
type
(
ALL
) mean that no index would be used, and
all rows would need to be examined to find the desired data. Depending on the
total number of rows, this could have a serious impact on the performance. We
can ascertain the exact impact by examining the query timing that phpMyAdmin
displays on each result page (
Query
took
x
sec
), and comparing it with or without
the index. However, the difference in time can be minimal if we only have limited
test data, compared to a real table in production. For more details about the
EXPLAIN
output format, please refer to
http://dev.mysql.com/doc/refman/5.5/en/
explain-output.html
.
Detecting index problems
To help users maintain an optimal index strategy, phpMyAdmin tries to detect some
common index problems. For example, let us access the
book
table and add an index
on the
isbn
column. When we display this table's structure, we get a warning as
shown in the following screenshot:
The intention here is to warn us about an inefficient index structure when
considering the whole table. We don't need to have two indexes on the same column.
Search WWH ::
Custom Search