DELETE FROM temp_det
WHERE EXISTS (
SELECT 1
FROM temp_orders A,
orig_cap T
WHERE
A.DT = temp_det.DT AND
A.DT = T.DT AND
A.Prod_ID = temp_det.Prod_ID AND
T.Prod_ID = temp_det.Prod_ID AND
T.orig >= temp_det.orig)
Number of rows
temp_orders has 2 indexes
idxa-- dt
idxb-- prod_id
idxc--st,prod_id
temp_det
idxd-- dt,prod_id
idxe--dt
Is there a way to tune this to reduce the number of
hours to run this? This process whenever run , runs as the only process allowed in the database. Can We somehow disable the rollback and redo ? Is it a good idea when noone else can access the database to disable redo & rollback?
A composite index on ORIG_CAP(DT, ORIG) will solve your problem. Right now, without any index on ORIG_CAP Oracle must perform full table scan on ORIG_CAP for each row deleted. Also a composite index on TEMP_ORDERS(DT, PROD_ID) would speed things a bit.
BTW, neither the number of extents nor the large rollback segment assigment are in any way relevant for the performance of this DML.
[Edited by jmodic on 11-13-2001 at 09:47 AM]
Jurij Modic ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
BTW, neither the number of extents nor the large rollback segment assigment are in any way relevant for the performance of this DML.
_________________________________________
thanks jurij,
I didn't pay attention to the sql statement that tansdot posted, there was an indexing problem to begin with.
For a while I thought it was an INSERT statement.....heheheheh...
Bookmarks