SQL Language (MOSC)

MOSC Banner

fixed code to remove costly delete

edited Jul 4, 2011 8:45PM in SQL Language (MOSC) 6 commentsAnswered
 I have the following routine I found runnig on my database (see current code).  I came up with alternate code (see alternate code) to capture the desired rows and remove the costly delete.  Mine tested fine and the run time is okay but I was just curious to see any more options that someone could come up with.  Especially since coding is not my thing.

---- current code   (this creates approx. 400K rows and then deletes all but approx. 10K!!!!)

truncate table temp_dir_history;

insert into temp_dir_history
select *
from dir_history
where trunc(record_date) = trunc(sysdate) and directory_file Not like '%adminpc%';

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center