|
本帖最后由 lfree 于 2011-10-9 16:15 编辑
variable x number;
exec :x :=1;
Select /*+ gather_plan_statistics */ * from T where n=:x;
N V
---------- ----------------------------------------------------------------------------------------------------
1 ****************************************************************************************************
SQL> SELECT * FROM table(dbms_xplan.display_cursor(NULL, NULL,'ALLSTATS LAST +PEEKED_BINDS'));
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID 3aajxkvtwhz38, child number 0
-------------------------------------
Select /*+ gather_plan_statistics */ * from T where n=:x
Plan hash value: 2912310446
-----------------------------------------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers |
-----------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | | 1 |00:00:00.01 | 4 |
| 1 | TABLE ACCESS BY INDEX ROWID| T | 1 | 1 | 1 |00:00:00.01 | 4 |
|* 2 | INDEX RANGE SCAN | I_T_N | 1 | 1 | 1 |00:00:00.01 | 3 |
-----------------------------------------------------------------------------------------------
Peeked Binds (identified by position):
--------------------------------------
1 - (NUMBER): 1
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("N"=:X)
24 rows selected.
sql_id='3aajxkvtwhz38';
SQL> SELECT child_number, executions, buffer_gets, is_bind_sensitive, is_bind_aware, is_shareable FROM v$sql WHERE sql_id = '3aajxkvtwhz38' ;
CHILD_NUMBER EXECUTIONS BUFFER_GETS I I I
------------ ---------- ----------- - - -
0 1 4 Y N Y
|
|