1Z0-909 · Question #43
Examine this statement and output: Which is true?
The correct answer is C. myview was defined with the temptable processing algorithm. Option C is correct because MySQL's TEMPTABLE algorithm causes the view to be fully materialized into a temporary table before the outer query runs against it. That temporary table has no indexes, so no index from the underlying base table can be leveraged, and no index can be…
Question
Examine this statement and output:
Which is true?
Exhibit
Options
- AThe underlying table's index on the Name column is not chosen because of low selectivity.
- Bmyview cannot be automatically indexed.
- Cmyview was defined with the temptable processing algorithm.
- DColumn Name in myview can be indexed if the is_updatable attribute is true.
How the community answered
(52 responses)- A10% (5)
- B6% (3)
- C83% (43)
- D2% (1)
Explanation
Option C is correct because MySQL's TEMPTABLE algorithm causes the view to be fully materialized into a temporary table before the outer query runs against it. That temporary table has no indexes, so no index from the underlying base table can be leveraged, and no index can be created on the view's columns during query execution.
Why the distractors are wrong:
- A is incorrect because the index isn't skipped due to low selectivity - it simply can't be used at all once the data lands in an unindexed temp table.
- B is a symptom, not the cause; saying the view "cannot be automatically indexed" is a consequence of the
TEMPTABLEalgorithm, not an independent reason. - D is incorrect because
is_updatablegoverns whether DML (INSERT/UPDATE/DELETE) can be performed on the view - it has no bearing on whether columns can be indexed.
Memory tip: Associate TEMPTABLE with "throw away the filing cabinet" - once rows are copied into a temporary table, all the original indexes are left behind, making full scans unavoidable.
Topics
Community Discussion
No community discussion yet for this question.
