set timing on set serveroutput on declare PROCEDURE nobind IS TYPE rc IS REF CURSOR; l_rc rc; l_dummy all_objects.object_name%TYPE; l_start NUMBER DEFAULT dbms_utility.get_time; BEGIN FOR i IN 1 .. 15 LOOP OPEN l_rc FOR 'select object_name from all_objects where object_id = ' || i; FETCH l_rc INTO l_dummy; CLOSE l_rc; END LOOP; dbms_output.put_line(round((dbms_utility.get_time - l_start) / 100, 2) || ' seconds…'); END; PROCEDURE bind IS TYPE rc IS REF CURSOR; l_rc rc; l_dummy all_objects.object_name%TYPE; l_start NUMBER DEFAULT dbms_utility.get_time; BEGIN FOR i IN 1 .. 15 LOOP OPEN l_rc FOR 'select object_name from all_objects where object_id = :x' USING i; FETCH l_rc INTO l_dummy; CLOSE l_rc; END LOOP; dbms_output.put_line(round((dbms_utility.get_time - l_start) / 100, 2) || ' seconds…'); END; begin -- first warm up nobind ; bind -- now start testing runstats_pkg.rs_start; nobind; runstats_pkg.rs_middle; bind; runstats_pkg.rs_stop(100); end; / 1 seconds… .07 seconds… .01 seconds… .01 seconds… Run1 ran in 1 hsecs Run2 ran in 1 hsecs run 1 ran in 100% of the time Name Run1 Run2 Diff LATCH.library cache pin 336 36 -300 LATCH.library cache lock 410 39 -371 LATCH.library cache 920 134 -786 STAT...session pga memory max 196,608 0 -196,608 STAT...session uga memory max 211,904 0 -211,904 Run1 latches total versus runs -- difference and pct Run1 Run2 Diff Pct 2,307 763 -1,544 302.36% PL/SQL procedure successfully completed. Elapsed: 00:00:01.72