Deleting records using timestamp as condition
618026Sep 4 2008 — edited Sep 4 2008Hi,
I have a database where I would like to delete all records in two tables if they are older than 90 days.
The thing is that this database is really large and the following statement takes forever to run.
So, my question is - can the following be done more efficient?
DELETE *
FROM CART, CARTITEM
WHERE
EXTRACT( DAY FROM (systimestamp-CART.LASTMODIFIED) ) > 30
AND CART.CARTID = CARTITEM.CARTID;
Hope you guys have some thoughts! =)
/Paul