1Z0-888 · Question #3
Consider: mysql> EXPLAIN SELECT FROM City WHERE Name = 'Jacksonville' AND CountryCode = 'USA'\G *********************** 1. row ************************ id: 1 select_type: SIMPLE table: city type…
The correct answer is A. It shows how many bytes will be used from each index row. key_len reports the number of bytes MySQL will read from each index entry to satisfy the query - it's a byte-length measurement of the index prefix actually used. Here, key_len: 13 means MySQL is consuming 13 bytes of the name_country_index, which corresponds to both the Name…
Question
Options
- AIt shows how many bytes will be used from each index row.
- BIt shows the number of characters indexed in the key.
- CIt shows the total size of the index row.
- DIt shows how many columns in the index are examined.
How the community answered
(13 responses)- A77% (10)
- B8% (1)
- C15% (2)
Explanation
key_len reports the number of bytes MySQL will read from each index entry to satisfy the query - it's a byte-length measurement of the index prefix actually used. Here, key_len: 13 means MySQL is consuming 13 bytes of the name_country_index, which corresponds to both the Name and CountryCode columns being fully used (as confirmed by ref: const, const).
Why the distractors are wrong:
- B is wrong because
key_lenis always in bytes, not characters - a critical distinction when multi-byte charsets (e.g., UTF-8) are involved, where one character can occupy 2–4 bytes. - C is wrong because
key_lenonly reflects the used portion of the index, not the full index row size (which includes internal overhead MySQL doesn't expose here). - D is wrong because
key_lenis a byte count, not a column count - you must infer the number of columns used by knowing each column's byte width and doing the math yourself.
Memory tip: Think of key_len as the "ruler measurement" of how far into the index key MySQL reaches - bigger bytes = more of the index is being used, which generally means a more selective, efficient lookup.
Topics
Community Discussion
No community discussion yet for this question.