Just a mental note for myself for using explain plan:
[ZZXJFF@OCP04:W2ZZXJFF02] SQL> explain plan for 2 select 'blaat' from dual; Explained. [ZZXJFF@OCP04:W2ZZXJFF02] SQL> select * from table (dbms_xplan.display) dual; PLAN_TABLE_OUTPUT ---------------------------------------------------------------------------------------------------- Plan hash value: 1388734953 ----------------------------------------------------------------- | Id | Operation | Name | Rows | Cost (%CPU)| Time | ----------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 2 (0)| 00:00:01 | | 1 | FAST DUAL | | 1 | 2 (0)| 00:00:01 | ----------------------------------------------------------------- 8 rows selected.
To create a plan table:
Connect to sqlplus with the user who’ll own the PLAN_TABLE table and issue:
SQL> @?/rdbms/admin/utlxplan
If this doesn’t work: click