QuestionQ128

Performance

Examine the following query output:

Question Image

Which two statements are correct?

Choose two
  • A The country table is accessed as the first table, and then joined to the city table.
  • B It takes more than 8 milliseconds to sort the rows.
  • 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.
  • E The query returns exactly 125 rows.
Explanation

The nested-loop execution begins with the country table scan and its Continent = 'Asia' filter; it then uses each qualifying country code to look up matching city rows. The plan estimates 34 rows for the Asia filter but actually returns 51. EXPLAIN ANALYZE reports the time to the first row and to completion for an iterator, so the sort range from 8.306 to 8.431 ms is 0.125 ms. The final sort iterator returns 125 rows in one loop, which is the query’s result-row count.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!