EXPLAIN Output Format This join type indicates that the Index Merge optimization is used. In this case, the  key  column in the output row contains a list of indexes used, and  key_len  contains a list of the longest key parts for the indexes used. For more information, see Section 8.2.1.3, “Index Merge Optimization” . This type replaces  eq_ref  for some  IN  subqueries of the following form: value  IN (SELECT  primary_key  FROM  single_table  WHERE  some_expr ) unique_subquery  is just an index lookup function that replaces the subquery completely for better efficiency. This join type is similar to  unique_subquery . It replaces  IN  subqueries, but it works for nonunique indexes in subqueries of the following form: value  IN (SELECT  key_column  FROM  single_table  WHERE  some_expr ) Only rows that are in a given range are retrieved, using an index to select the rows. The  key  column in the output row indicates which index is used. The  key_len  contains the longest key part that was used. The  ref  column is  NULL  for this type. range  can be used when a key column is compared to a constant using any of the  = ,  <> ,  > ,  >= ,  < ,  <= , IS NULL ,  <=> ,  BETWEEN ,  LIKE , or  IN()  operators: The  index  join type is the same as  ALL , except that the index tree is scanned. This occurs two ways: MySQL can use this join type when the query uses only columns that are part of a single index. A full table scan is done for each combination of rows from the previous tables. This is normally not good if the table is the first table not marked  const , and usually  very  bad in all other cases. Normally, you 1768 • ALL •A full table scan is performed using reads from the index to look up data rows in index order.  Uses index  does not appear in the  Extra  column. •If the index is a covering index for the queries and can be used to satisfy all data required from the table, only the index tree is scanned. In this case, the  Extra  column says  Using index . An index- only scan usually is faster than  ALL  because the size of the index usually is smaller than the table data. • index • range • index_subquery • unique_subquery SELECT * FROM  tbl_name WHERE  key_column  = 10; SELECT * FROM  tbl_name WHERE  key_column  BETWEEN 10 and 20; SELECT * FROM  tbl_name WHERE  key_column  IN (10,20,30); SELECT * FROM  tbl_name WHERE  key_part1  = 10 AND  key_part2  IN (10,20,30);