Note that there are some explanatory texts on larger screens.

plurals
  1. POpl/sql Stored procedure... where does the execution time go?
    primarykey
    data
    text
    <p>I am currently tracing a performance leak in a stored procedure. Having a timestamp put out right after the initial "begin" and one right before the final "end" (I am doing a commit <em>before</em>) says the procedure takes abt. 10 secs to finish. However, I have to wait 2mins+ for it to end.</p> <p>Can anybody tell me where the rest of the times goes? I am using Oracle SQL dev but It doesn't seem to be idleing for the rest of the time, the procedure seems to hold a lock on the respective table :(</p> <p>Thanks a lot in advance for enlightening....</p> <p><strong>EDIT:</strong> thanks again for your input :) here's the stripped code for the procedure, depending on the number of items to be processed, the 1st section currently takes abt. 10 to 40 seconds, the 2nd section a few millisecs. however the procedure takes 2 to 8 mins to run. also, the table containing the data to delete seem to be locked somewhat longer than needed, causing inserts to be deferred. starting it as scheduled job makes no difference btw, same behavior.</p> <pre><code>create or replace procedure MY_PROCEDURE is start_procedure number; start_delete number; end_procedure number; begin start_procedure :=dbms_utility.get_time; begin -- stripped: doing some selects/updates here end; commit; start_delete :=dbms_utility.get_time ; begin -- stripped: cleanig up some other data here end; commit; end_procedure :=dbms_utility.get_time ; dbms_output.put_line('procedure took: '||to_char((end_procedure- start_procedure)/1000)); dbms_output.put_line('updates took: '||to_char((start_delete- start_procedure)/1000)); dbms_output.put_line('delete took: '||to_char((end_procedure-start_delete)/1000)); end; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload