The key to performance optimization is to find the right direction, for example, for a PL/SQL code, we think it is slow to execute, but in the end it needs a measurable tool to analyze, and we sometimes like to leave debug code in it, like using dbms_utility.get_ Time is spent on the execution of the statement, which can be cumbersome if the code is large.
PL/SQL Developer provides this functionality, as described here
PL/SQL Developer Overview charts can be done for each line of code that has been run, the total time, the maximum time, the shortest time, the average time, and the number of runs will be counted. You can easily access the overview diagram in the Test window. Just press the Create overview report button in the Test window toolbar before you run the test script. If you then run the script, you can go to the Overview Chart tab to view the report.
Here is an example.
I'm going to measure my proc_test stored procedure.
The test window is as follows
2. Click the Overview Map button
If this is the first time, you will be prompted to create the base table used by the overview chart analysis
In fact, in the database created two Zhang Kiju, respectively, to create a plsql_profiler_data,plsql_profiler_runnumber, the point is to confirm.
Execute our program and look at the results after completion.
This is the most time to see Update target_tab, followed by select COUNT (*).
In this way, you can locate the most time-consuming operation in the program and spend it there, and we'll drill down and get the most out of tuning there.
Anatomy of PL/SQL code using PL/SQL Developer Overview diagram