Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Deleting records using timestamp as condition

618026Sep 4 2008 — edited Sep 4 2008
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2008
Added on Sep 4 2008
8 comments
3,725 views