Hi,

I have a table with 26 million of records and other with 130000.

I need to update the bigger table with the other and I have indexes and the Explain show a good number for rons, however when run the update process...exactly when the process is in the middle the performance is down.

Somebody have a idea to fix this?

the query is:

UPDATE inafilia.IM_DERECHOHABIENTES D
SET (
NOMBRE, AP_PATERNO,AP_MATERNO,SEXO, FECHA_NAC, DOCTO,FH_DOCTO)
= (
select
CASE WHEN MO.TIPO_MOVIMIENTO = '01' THEN MO.NOMBRE
ELSE D.NOMBRE
END,
CASE WHEN MO.TIPO_MOVIMIENTO = '01' THEN MO.AP_PATERNO
ELSE D.AP_PATERNO
END,
CASE WHEN MO.TIPO_MOVIMIENTO = '01' THEN MO.AP_MATERNO
ELSE D.AP_MATERNO
END,
CASE WHEN MO.SEXO = '2' THEN 'F'
ELSE 'M'
END,
CASE
WHEN MO.TIPO_MOVIMIENTO = '01' THEN fecha_tms(MO.fec_NAC)
else
case
when d.fecha_nac is null then NULL
else d.FECHA_NAC
end
END,
'MO',
TIMESTAMP(CURRENT DATE,'00.00.00')
from UNICOSXNSS MO where MO.nss = D.NSS
)
where D.NSS IN (select nss from UNICOSXNSS)
;