Monday 22 February 2016

How to get run time statistics for a query?

Step 1:
Add the hint gather_plan_statistics to the select statement:


SELECT /*+ GATHER_PLAN_STATISTICS */
name,address,code
from address_name_table;

Step 2:
Generate the plan and the run time statistics:


select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));