1Z0-908 · Question #64
Examine this query and output: Which two statements are true? (Choose two.)
The correct answer is C. The optimizer estimates that 51 rows in the country table have Continent = `Asia'. D. 35 rows from the city table are included in the result. Options C and D correctly describe what can be read from a MySQL EXPLAIN output. The rows column in EXPLAIN shows the optimizer's estimate of rows to be examined per table - so seeing 51 for the country table filtered on Continent = 'Asia' is exactly that: an estimate (C)…
Question
Examine this query and output:
Which two statements are true? (Choose two.)
Exhibit
Options
- AThe country table is accessed as the first table, and then joined to the city table.
- BIt takes more than 8 milliseconds to sort the rows.
- CThe optimizer estimates that 51 rows in the country table have Continent = `Asia'.
- D35 rows from the city table are included in the result.
- EThe query returns exactly 125 rows.
How the community answered
(40 responses)- A5% (2)
- B10% (4)
- C65% (26)
- E20% (8)
Explanation
Options C and D correctly describe what can be read from a MySQL EXPLAIN output. The rows column in EXPLAIN shows the optimizer's estimate of rows to be examined per table - so seeing 51 for the country table filtered on Continent = 'Asia' is exactly that: an estimate (C). Likewise, the 35 shown for the city table represents the rows the optimizer expects to process from that table in the join (D).
Why the distractors fail:
- A is wrong because
EXPLAINoutput lists tables in access order, and ifcityappears first, it's accessed first - notcountry. The join direction is the opposite of what A claims. - B is wrong because
EXPLAIN(withoutANALYZE) shows cost/row estimates, not actual execution time - there are no millisecond timings in standardEXPLAINoutput. - E is wrong because the
rowscolumn is an estimate, not a guarantee. The actual number of returned rows can differ from what the optimizer predicts.
Memory tip: Think "EXPLAIN = estimates, not facts." The rows column is always the optimizer's guess - never the exact result count. Table order in the output = the join access order, so read top-to-bottom to trace which table gets hit first.
Topics
Community Discussion
No community discussion yet for this question.
