In the following query, the Population column is indexed:
mysql> EXPLAIN SELECT Name
-> FROM Country
-> WHERE Code LIKE '%B%' AND Population > 10000 \G
************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: Country
type: ALL
possible_keys: i_pop
key: NULL
key_len: NULL
ref: NULL
rows: 239
Extra: Using where
Which of the following best describes how to deal with the key value of the EXPLAIN output?
Consider the following:
mysql> EXPLAIN SELECT DISTINCT City.id,City.name
-> FROM City,Country
-> WHERE Country.Name IN ('United States','Canada','Mexico')
-> AND City.CountryCode=Country.Code
-> ORDER BY name\G
************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: City
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 4079
Extra: Using temporary; Using filesort
************************** 2. row ***************************
id: 1
select_type: SIMPLE
table: Country
type: eq_ref
possible_keys: PRIMARY
key: PRIMARY
key_len: 3
ref: world.City.CountryCode
rows: 1
Extra: Using where; Distinct
Which of the following best describes the meaning of the values in the ref columns?
Consider the following:
mysql> EXPLAIN SELECT * FROM City WHERE Name = 'Jacksonville' AND CountryCode
='USA'\G
************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: City
type: ref
possible_keys: name_country_index
key: name_country_index
key_len: 13
ref: const,const
rows: 1
Extra: Using where
Which of the following best describes the meaning of the value for the key_len column?
Consider the following:
mysql> EXPLAIN SELECT * FROM City WHERE CountryCode = 'USA'\G
************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: City
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 4079
Extra: Using where
Which of the following best describes the meaning of the "id" column in the output from EXPLAIN?