tags:

views:

52

answers:

3

In Oracle are indexes used when an UPDATE is fired without a WHERE clause

+2  A: 

If you update affects indexed columns, then the index pages will need to be replaced as well.

nonnb
+5  A: 

By "used", do you mean "referred to" or "modified"?

An UPDATE without a WHERE clause boils down to an iteration over the entire table; I see no good reason why Oracle should refer to an index in this case, as there's no benefit to be had from that. (Although that's little more than a qualified guess.) nonnb is right that the index will be affected depending on what column you touch.

ig2r
+2  A: 

Will Oracle use the index to find the rows being updated? With no where clause, almost certainly not.

Will Oracle have to read one or more indexes, getting blocks in consistent mode to update them? If you're updating any columns that are indexed, have function-based indexes which will result in an updated indexed value, or cause row movement among partitions, then yes, indexes "will be used."

Adam Musch