Friday, February 16, 2024

Oracle Database 19c -- Display Actual Rows along with Estimated Rows on Execution Plans

Problem

You want to have Actual rows and Estimated rows statistics displayed on execution plan of a query

Solution

First enable the optimizer statistics gathering for a statement using hint:

/*+ GATHER_PLAN_STATISTICS */

After, display the execution plan with:

SELECT * FROM table(DBMS_XPLAN.DISPLAY_CURSOR(FORMAT=>'ALLSTATS LAST'));

Note that the above statement will display the execution plan of the last executed statement within that session

No comments: