nerdexam
Oracle

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)…

Performance Tuning

Question

Examine this query and output:

Which two statements are true? (Choose two.)

Exhibit

1Z0-908 question #64 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)
  • A
    5% (2)
  • B
    10% (4)
  • C
    65% (26)
  • E
    20% (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 EXPLAIN output lists tables in access order, and if city appears first, it's accessed first - not country. The join direction is the opposite of what A claims.
  • B is wrong because EXPLAIN (without ANALYZE) shows cost/row estimates, not actual execution time - there are no millisecond timings in standard EXPLAIN output.
  • E is wrong because the rows column 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

#execution plans#optimizer statistics#query performance#join analysis

Community Discussion

No community discussion yet for this question.

Full 1Z0-908 Practice