index question
So I have this update statement that needs to be run on a table with many records.
It's a simple statement like:
update TABLE1 set column1 = 'VALUE' where column2 = 'SOMETHING' ;
The update statement runs sort of slow, there is NO index on column2
So, just for having THIS statement run faster, it would be faster if there was an index on " column2 "
Now suppose I'm worried about locks.
To reduce the possibility on locks, I think this stament is better:
update TABLE1 set column1 = 'VALUE' where column2 = 'SOMETHING' and column1 <> 'VALUE' ;
But to have this statement be effective, I need an index on "column1" as well