To display the plan of ORACLE SQL query from SQL*plus/sqlplus, the following command can be used
SET AUTOTRACE ON
SQL> set autotrace on
SQL> select count(*) from employee;
COUNT(*)
----------
54405
Execution Plan
---------------------------------------------------------
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=1683 Card=1)
1 0 SORT (AGGREGATE)
2 1 TABLE ACCESS (FULL) OF 'EMPLOYEE' (TABLE) (Cost=1683 Card=54
276)
Statistics
---------------------------------------------------------
1 recursive calls
0 db block gets
7682 consistent gets
7625 physical reads
0 redo size
534 bytes sent via SQL*Net to client
664 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
The SET AUTOTRACE OFF will turn off the display of plan.
No comments:
Post a Comment