delete rows
I am attempting to delete 3000 rows from a 215 million record table (auditlog) which has a criteria coming from payment atble which is 35 million.
What is the best way to perform this delete. I ahve tried various options but all of them are taking very long time like more than an hour and still going..
When I perform only on payment the records get deleted very quickly like 2 minutes.
Here is the query that completes in 2 minutes
SQL> delete FROM PAYMENT WHERE TRUNC(SYSDATE -120) <= TO_DATE(CREATEDATE,'j');2256 rows deleted.Here is the query that never finishes...SQL> delete from auditlog where LOGGEDOBJECTID IN ( select /*+ FULL(PAYMENT) PARALLEL(PAYMENT,4) */ id from ebpp.payment WHERE TRUNC(SYSDATE - 120)<= TO_DATE(CREATEDATE,'j'));delete from auditlog where LOGGEDOBJECTID IN ( select /*+ FULL(PAYMENT) PARALLEL(PAYMENT,4) */ id from ebpp.payment WHERE TRUNC(SYSDATE - 120)<= TO_DATE(CREATEDATE,'j'))*ERROR at line 1:ORA-01013: user requested cancel of current operation Elapsed: