How could I further optimize this update query, since I have to update 200,000 records and the oracle session ends and I cannot update anything, not even by placing ROWNUM
I get the error: ORA-00028: your session has been killed
UPDATE TMP_IOP_AJUSTE_TRF_RCBD_PSTVS P
SET P.PLAZA = (SELECT T.NOMCAS FROM TMP_IOP_AJUSTE_TRF_RCBD2_TEST T WHERE T.SEQ=P.SEQ)
WHERE P.NUM_DEC IN ('E422') AND P.PLAZA IS NULL AND ROWNUM <=10000
You seem to be missing indices, at least:
Here the detail is that for each record in
P
the subquery is performed; Subject to knowing how is the relationshipseq
betweenP
andT
you can reduce the execution time with aMERGE
: