Bug #79717 Document Bug about "EXPLAIN Output Format"
Submitted: 21 Dec 2015 2:47 Modified: 26 Feb 2016 0:13
Reporter: Yoshiaki Yamasaki Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: explain

[21 Dec 2015 2:47] Yoshiaki Yamasaki
Description:
[Target Document]
https://dev.mysql.com/doc/refman/5.7/en/explain-output.html#explain-join-types
https://dev.mysql.com/doc/refman/5.6/en/explain-output.html#explain-join-types
https://dev.mysql.com/doc/refman/5.5/en/explain-output.html#explain-join-types
https://dev.mysql.com/doc/refman/5.1/en/explain-output.html#explain-join-types
https://dev.mysql.com/doc/refman/5.0/en/explain-output.html#explain-join-types
 => Description of "unique_subquery" part

[Detail]
I think description of unique_subquery is wrong as follows.

 Now              : This type replaces ref for some IN subqueries of the following form: 
 Modified version : This type replaces const for some IN subqueries of the following form: 

Because unique_subquery use primary key or unique key. Therefore, I think "ref" is worng. I think "const" is correct.

How to repeat:
N/A

Suggested fix:
Please see Description.
[21 Dec 2015 9:11] MySQL Verification Team
Thank you for the bug report.
[25 Feb 2016 16:34] Paul DuBois
Comment from one of the optimizer developers:

I think it should be:

This type replaces eq_ref for some IN subqueries of the following form:

const means that the value is constant in optimization phase.  AFAICT, this is not the case here.  In this case, there may be multiple index look-ups for different values.
[25 Feb 2016 16:35] 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.
[26 Feb 2016 0:13] Yoshiaki Yamasaki
Hi Paul,

Thank you! I checked the modified document.