performance - pl/sql Stored procedure... where does the execution time go? -


I'm currently detecting a performance leak in a stored procedure last "end" (I before ) before putting an accurate timestamp after an initial "start" and that process seems abt. 10 seconds to finish, however, I have to wait 2 minutes + to finish it.

Can anyone tell me where the rest of the time goes? I am using Oracle SQL Dev but it does not look useless for the rest of the time, the process is locked on the related table: (

Thank you very much for the educator.

Edit: Thanks again for your input :) Here is the stripped code for the process, depending on the number of items to be processed, in the first part ABT 10 to 40 seconds, the second volume is a few milliseconds, although this process takes 2 to 8 minutes to run. Also, the table that destroys the data is locked for some time, due to which the inserts are postponed. BTW, there is no difference in starting this as a scheduled job.

  Process to create or change process is MY_PROCEDURE start_procedure number; Start_delete number; End_processor number; Start_procomure: = dbms_utility.get_time; Start - stripped: some selection / update ends here; Committed; Start_delete: = dbms_utility.get_time; Start - Snatched: Clear some other data here; Committed; End_procedure: = dbms_utility.get_time; Dbms_output.put_line ('Process Taken:' to_char ((end_procedure-start_procedure) / 1000)); Dbms_output.put_line ('updated:' to_char ((start_delete-start_procedure) / 1000)); Dbms_output.put_line ('deleted:' || to_char ((end_procedure-start_delete) / 1000)); End;  

I think you need to divide by 100, not 1000 (dbms_utility .get_time gives time in Sentixand) It should give you 100 seconds, which is about 2 minutes.

However, if you are interested in finding out where the 2-minute execution time was and the complexity of the process, you either want to do the following:

    < Li> Use a PL / SQL hierarchical profiler () to collect a statistic report report before taking the snapshot before and after the process runs

Profiler can be better if you have too many PL PL / SQL process calls Statspack report may be better if you have mostly SQL statements inside the stored procedure.

Here's what the profiler output looks like:

  Sample report function Elapsed time (microsec) data Total subtitle time passed (microsecope) 2831 microscope ( Time spent) 12 Function Calls Sorted by Sub-Inds% Function Delay Industries% Call Ind% Name of Function 2831 100% 93 2738 96.7% 2 16.7% __plsq_vm 2738 96.7% 310 2428 85.8% 2 16.7% __anonymous_block 2428 85.8% 15 2413 85.2% 1 8.3% hr. .test (line1) 2413 85.2% 435 1 9 78 69.9% 3 25.0% Human Resources. Test. FOO (Line 3) 1978 69.9% 1978 0 0.0% 3 25.0% HRT.Test .__ Static_SCL_XA_Line 5 (Line 5) 0 0.0% 0 0 0.0% 1 8.3% SYS.DBMS_HPROF.STOP_PROFILING (line 53) < / Code> 

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -