- 1* select sql_text from dba_sql_plan_baselines where sql_handle='SYS_SQL_c9bc6fc0e997f27c'
- SQL> /
- SQL_TEXT
- --------------------------------------------------------------------------------
- select department_name
- from hr.departments dept
- where department_id in (select department_id from hr.employees emp)
- and department_name=:name
- SQL> explain plan for
- 2 select department_name
- 3 from hr.departments dept
- 4 where department_id in (select department_id from hr.employees emp)
- 5 and department_name=:name;
- Explained.
- SQL> select*from table(dbms_xplan.display());
- PLAN_TABLE_OUTPUT
- ---------------------------------------------------------------------------------------------
- Plan hash value: 2317224448
- ----------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- ----------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 1 | 19 | 7 (15)| 00:00:01 |
- |* 1 | HASH JOIN SEMI | | 1 | 19 | 7 (15)| 00:00:01 |
- |* 2 | TABLE ACCESS FULL| DEPARTMENTS | 1 | 16 | 3 (0)| 00:00:01 |
- | 3 | TABLE ACCESS FULL| EMPLOYEES | 107 | 321 | 3 (0)| 00:00:01 |
- ----------------------------------------------------------------------------------
- Predicate Information (identified by operation id):
- ---------------------------------------------------
- 1 - access("DEPARTMENT_ID"="DEPARTMENT_ID")
- 2 - filter("DEPARTMENT_NAME"=:NAME)
- Note
- —–
- - SQL plan baseline SYS_SQL_c9bc6fc0e997f27c used for this statement
更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
