Dear all,
I have a table that has 1.3 million records.
The full insert of that data using external tables takes 2.3 minutes. Which is really nice time.
But when i try and update the full table takes up to 20 minutes. The update takes place every 30 minutes and its updating at least 1 million records of the full table.
Here is the query:
CREATE OR REPLACE PROCEDURE TestUpdateTMIRecordsStaging
IS
BEGIN
MERGE INTO TMI_PARAMETERS T
USING TMI_PARAMETERS_STAGING L
ON (T.ID = L.ID
AND
T.ORBIT = L.ORBIT)
WHEN MATCHED THEN
UPDATE
SET
T.TIME_MIN = L.TIME_MIN,
T.SEA_SURFACE_TEMP_C = L.SEA_SURFACE_TEMP_C,
T.Z_WINDS_MS = L.Z_WINDS_MS,
T.W_WINDS_MS = L.W_WINDS_MS,
T.WATER_VAPOUR_MM = L.WATER_VAPOUR_MM,
T.CLOUD_LIQUID_WATER_MM = L.CLOUD_LIQUID_WATER_MM,
T.RAIN_RATE_MMHR = L.RAIN_RATE_MMHR
WHEN NOT MATCHED THEN
INSERT(T.TIME_MIN,T.SEA_SURFACE_TEMP_C,T.Z_WINDS_MS,T.W_WINDS_MS,
T.WATER_VAPOUR_MM,T.CLOUD_LIQUID_WATER_MM,T.RAIN_RATE_MMHR)
VALUES(L.TIME_MIN,L.SEA_SURFACE_TEMP_C,L.Z_WINDS_MS,L.W_WINDS_MS,
L.WATER_VAPOUR_MM,L.CLOUD_LIQUID_WATER_MM,L.RAIN_RATE_MMHR);
END;
/
Is there anything that i am doing wrong? Or any advice on how i can speed up this update?
Using Oracle 9i.
Thank you so much for your time.
Looking forward to your response.
Cheers
Dan
I have a table that has 1.3 million records.
The full insert of that data using external tables takes 2.3 minutes. Which is really nice time.
But when i try and update the full table takes up to 20 minutes. The update takes place every 30 minutes and its updating at least 1 million records of the full table.
Here is the query:
CREATE OR REPLACE PROCEDURE TestUpdateTMIRecordsStaging
IS
BEGIN
MERGE INTO TMI_PARAMETERS T
USING TMI_PARAMETERS_STAGING L
ON (T.ID = L.ID
AND
T.ORBIT = L.ORBIT)
WHEN MATCHED THEN
UPDATE
SET
T.TIME_MIN = L.TIME_MIN,
T.SEA_SURFACE_TEMP_C = L.SEA_SURFACE_TEMP_C,
T.Z_WINDS_MS = L.Z_WINDS_MS,
T.W_WINDS_MS = L.W_WINDS_MS,
T.WATER_VAPOUR_MM = L.WATER_VAPOUR_MM,
T.CLOUD_LIQUID_WATER_MM = L.CLOUD_LIQUID_WATER_MM,
T.RAIN_RATE_MMHR = L.RAIN_RATE_MMHR
WHEN NOT MATCHED THEN
INSERT(T.TIME_MIN,T.SEA_SURFACE_TEMP_C,T.Z_WINDS_MS,T.W_WINDS_MS,
T.WATER_VAPOUR_MM,T.CLOUD_LIQUID_WATER_MM,T.RAIN_RATE_MMHR)
VALUES(L.TIME_MIN,L.SEA_SURFACE_TEMP_C,L.Z_WINDS_MS,L.W_WINDS_MS,
L.WATER_VAPOUR_MM,L.CLOUD_LIQUID_WATER_MM,L.RAIN_RATE_MMHR);
END;
/
Is there anything that i am doing wrong? Or any advice on how i can speed up this update?
Using Oracle 9i.
Thank you so much for your time.
Looking forward to your response.
Cheers
Dan