title: pl/sql Stored procedure... where does the execution time go?
body: <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>