原帖由 erpmeng 于 2010-8-17 16:32 发表 thread-1338063-1-1.html

怎么执行呢??

和版本有关系,我这边是先set serverout off,然后执行sql才能查,晕

DINGJUN123>set serveroutput off

DINGJUN123>select * from product where id=1;

ID

----------

已选择 1 行。

DINGJUN123>select * from table(dbms_xplan.display_cursor);

PLAN_TABLE_OUTPUT

----------------------------------------------------------------------------------------------------

SQL_ID  18j7c4qrhg5an, child number 0

-------------------------------------

select * from product where id=1

Plan hash value: 1133877822

--------------------------------------------------------------------------------------------

| Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)| Time     |

--------------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT            |              |       |       |     1 (100)|          |

|   1 |  TABLE ACCESS BY INDEX ROWID| PRODUCT      |     1 |   310 |     1   (0)| 00:00:01 |

|*  2 |   INDEX UNIQUE SCAN         | SYS_C0018568 |     1 |       |     0   (0)|          |

--------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):

---------------------------------------------------

2 - access("ID"=1)

已选择19行。

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐