I am updating a column on tableA with data from tableB like this:
update tableA set bKey = select bKey from tableB B where B.colB = tableA.colB
bKey has a unique index on tableB.
Which is the better optimisation for this query, indexing tableB on ColB or (ColB,bKey) and why?
I am interested in answers for any database.