For maximum efficiency in join operations of one column from each of two tables, which of the following statements regarding indexes are true?
A.
In a LEFT JOIN such as table1 LEFT JOIN table2 ON table1 .a = table2.b, the column b in table2 should always be indexed
B.
A LEFT JOIN would not benefit from either of the participating columns being indexed
C.
In an INNER JOIN, either, but not both, columns participating in the join should be indexed
D.
In an INNER JOIN, both columns participating in the join should be indexed
E.
An INNER JOIN would not benefit from either of the participating columns being indexed “Pass Any
F.
In a LEFT JOIN such as table 1 LEFT JOIN table2 ON table 1 .a = table2.b, the column a in table 1should always be indexed
Explanation:
In a LEFT JOIN MySQL scans ALL of the 1st Table and then compares this to values in the second table.
— if the second table has indexes this will speed up the query process.
— In an INNER JOIN MySQL looks for matches only.
— The optimizer decided which table is best to use first chooses SHORTEST TIME FOR SCANNING table, and then compares results in this to second table.
— By having indexes on both it can choose first shortest table to scan and then will have indexes on the second (other) table to speed up query.