title: DBMS_XPLAN.DISPLAY_CURSOR vs Explain Plan if not using gather_plan_statistics hint
body: <p>Just requesting some clarification on the difference between the 2. From what I understand, EXPLAIN PLAN gives you the <em>theoretical</em> execution plan while DBMS_XPLAN.DISPLAY_CURSOR gives you the <em>actual</em> execution plan with execution statistics for the statement.</p>
  
  <p>EXPLAIN PLAN stores this data in a PLAN_TABLE while DBMS_XPLAN uses the V$SQL_PLAN, V$SQL_PLAN_STATISTICS and V$SQL_PLAN_STATISTICS_ALL views for its information.</p>
  
  <p>However, for DISPLAY_CURSOR to collect the actual runtime statistics for that statment, one needs to set the <code>/*+ gather_plan_statistics */</code> hint. Otherwise, only V$SQL_PLAN is filled which will only give you the execution plan but not the actual execution statistics. It is only with the <code>/*+ gather_plan_statistics */</code> where V$SQL_PLAN_STATISTICS is filled.</p>
  
  <p>So my question is, if I do not use the gather_plan_statistics hint, will EXPLAIN PLAN and DISPLAY_CURSOR always give me the same execution plan (for the same statement)?</p>