QUESTION POSED ON: 26 June 2007
I have a table with 1.5 million records that needs to have a column
updated based on a correlated subselect.
update updtbl a
set updcol =
(select rtnval
from srctbl s
where s.qcol1=a.qcol1
and s.qcol2=a.qcol2
and s.qcol3=a.qcol3
and s.qcol4=a.qcol4);
All the columns referenced in srctbl, including rtnval, are columns in an
index; qcol columns are the first ones in the index.
This update is currently sitting at four hours and counting. The database server
is on a Linux box. I have a lot more updates such as this to perform on
this database. What can I do to improve this performance?
|