1Z0-052 · Question #139
Which statement describes the effect on an index, when the indexed column for the rows is updated in the base table?
The correct answer is D. A row in the leaf block of the index for the key value is logically deleted and a new leaf row is inserted. Oracle BTree indexes handle column value updates by logically deleting the old index entry and inserting a new one, because an in-place key change would corrupt the ordered BTree structure.
Question
Which statement describes the effect on an index, when the indexed column for the rows is updated in the base table?
Options
- AAn update in a leaf row takes place.
- BThe index becomes invalid after the update.
- CThe leaf block containing the row to be updated is marked as invalid.
- DA row in the leaf block of the index for the key value is logically deleted and a new leaf row is inserted.
How the community answered
(25 responses)- A4% (1)
- C4% (1)
- D92% (23)
Why each option
Oracle BTree indexes handle column value updates by logically deleting the old index entry and inserting a new one, because an in-place key change would corrupt the ordered BTree structure.
An in-place update of the leaf row does not occur because changing the key value would violate the sorted order of the BTree, which requires a delete-and-reinsert approach instead.
The entire index does not become invalid after a single row update; Oracle maintains index validity through the logical delete and insert mechanism, and the index remains usable throughout.
The entire leaf block is not marked invalid; only the specific leaf entry for the updated row is logically deleted, while the rest of the block remains valid and accessible.
When a row's indexed column value is changed, Oracle cannot simply modify the existing leaf entry because the BTree must remain sorted by key value. Instead, the old leaf entry for the original value is marked as logically deleted (flagged with a deletion marker), and a new leaf entry is inserted at the correct sorted position for the updated value. This preserves BTree ordering and allows consistent index reads during the operation.
Concept tested: BTree index entry update mechanism in Oracle
Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/cncpt/indexes-and-index-organized-tables.html
Topics
Community Discussion
No community discussion yet for this question.