Bug #73379 Documentation says "Using where; using index" means key is being used for lookup
Submitted: 24 Jul 2014 20:26 Modified: 18 Feb 2016 19:24
Reporter: Justin Swanhart Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5, 5.6.21 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[24 Jul 2014 20:26] Justin Swanhart
Description:
Docs say "If the Extra column also says Using where, it means the index is being used to perform lookups of key values. Without Using where, the optimizer may be reading the index to avoid reading data rows but not using it for lookups. For example, if the index is a covering index for the query, the optimizer may scan it without using it for lookups."

How to repeat:
Create Table: CREATE TABLE `test_index` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT '11',
KEY `idx_test_index_a_b` (`a`,`b`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

mysql> explain select a,b from test_index where b=1 \G
id: 1
select_type: SIMPLE
table: test_index
type: index
possible_keys: NULL
key: idx_test_index_a_b
key_len: 10
ref: NULL
rows: 2
Extra: Using where; Using index

Note that the SQL layer will filter b=1 (thus, using where)
Using index is shown for the covering index
Type: index indicates full index scan

Using where does not indicate the index is being used for filtering - the docs are wrong

Suggested fix:
Remove the language from the documentation.
[24 Jul 2014 20:45] Sveta Smirnova
Thank you for the report.

Verified as described. The page is http://dev.mysql.com/doc/refman/5.1/en/explain-output.html
[18 Feb 2016 19:24] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.