Clarifications from Monty (by Zak).

parent 97f8ff17
...@@ -25397,12 +25397,15 @@ To see what indexes a table has, use @code{SHOW INDEX FROM tbl_name}. ...@@ -25397,12 +25397,15 @@ To see what indexes a table has, use @code{SHOW INDEX FROM tbl_name}.
@item key @item key
The @code{key} column indicates the key (index) that MySQL actually The @code{key} column indicates the key (index) that MySQL actually
decided to use. The key is @code{NULL} if no index was chosen. If decided to use. The key is @code{NULL} if no index was chosen. To force
MySQL chooses the wrong index, you can probably force MySQL to use an key listed in the @code{possible_keys} column, use
MySQL to use another index by using @code{myisamchk --analyze}, @code{USE KEY/IGNORE KEY} in your query.
@xref{myisamchk syntax}, or by using @code{USE INDEX/IGNORE INDEX}.
@xref{SELECT}. @xref{SELECT}.
Also, running @code{myisamchk --analyze} (@pxref{myisamchk syntax}) or
@code{ANALYZE TABLE} (@pxref{ANALYZE TABLE}) on the table will help the
optimiser choose better indexes.
@item key_len @item key_len
The @code{key_len} column indicates the length of the key that The @code{key_len} column indicates the length of the key that
MySQL decided to use. The length is @code{NULL} if the MySQL decided to use. The length is @code{NULL} if the
...@@ -34120,11 +34123,12 @@ table_name [[AS] alias] [USE INDEX (key_list)] [IGNORE INDEX (key_list)] ...@@ -34120,11 +34123,12 @@ table_name [[AS] alias] [USE INDEX (key_list)] [IGNORE INDEX (key_list)]
As of MySQL Version 3.23.12, you can give hints about which As of MySQL Version 3.23.12, you can give hints about which
index MySQL should use when retrieving information from a index MySQL should use when retrieving information from a
table. This is useful if @code{EXPLAIN} shows that MySQL is table. This is useful if @code{EXPLAIN} shows that MySQL is
using the wrong index. By specifying @code{USE INDEX (key_list)}, you using the wrong index from the list of possible indexes. By specifying
can tell MySQL to use only one of the specified indexes to @code{USE INDEX (key_list)}, you can tell MySQL to use only one of the
find rows in the table. The alternative syntax @code{IGNORE INDEX possible indexes to find rows in the table. The alternative syntax
(key_list)} can be used to tell MySQL to not use some @code{IGNORE INDEX (key_list)} can be used to tell MySQL to not use some
particular index. particular index.
@code{USE/IGNORE KEY} are synonyms for @code{USE/IGNORE INDEX}. @code{USE/IGNORE KEY} are synonyms for @code{USE/IGNORE INDEX}.
@item @item
...@@ -34516,11 +34520,12 @@ cases where the join optimiser puts the tables in the wrong order. ...@@ -34516,11 +34520,12 @@ cases where the join optimiser puts the tables in the wrong order.
As of MySQL Version 3.23.12, you can give hints about which As of MySQL Version 3.23.12, you can give hints about which
index MySQL should use when retrieving information from a index MySQL should use when retrieving information from a
table. This is useful if @code{EXPLAIN} shows that MySQL is table. This is useful if @code{EXPLAIN} shows that MySQL is
using the wrong index. By specifying @code{USE INDEX (key_list)}, you using the wrong index from the list of possible indexes. By specifying
can tell MySQL to use only one of the specified indexes to @code{USE INDEX (key_list)}, you can tell MySQL to use only one of the
find rows in the table. The alternative syntax @code{IGNORE INDEX possible indexes to find rows in the table. The alternative syntax
(key_list)} can be used to tell MySQL to not use some @code{IGNORE INDEX (key_list)} can be used to tell MySQL to not use some
particular index. particular index.
@findex USE KEY @findex USE KEY
@findex IGNORE KEY @findex IGNORE KEY
@code{USE/IGNORE KEY} are synonyms for @code{USE/IGNORE INDEX}. @code{USE/IGNORE KEY} are synonyms for @code{USE/IGNORE INDEX}.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment