test@DLSP>exec
dbms_sqltune.drop_sql_profile('profile_aa8mzbnrzu42f_dwrose'); PL/SQL procedure
successfully completed. test@DLSP>var
a varchar2(100) test@DLSP>exec
:a :='Inactive'; PL/SQL procedure
successfully completed. test@DLSP>select
count(name) from test where status= :a; COUNT(NAME) ----------- 100 test@DLSP>@profile Enter value for
sql_id: aa8mzbnrzu42f PLAN_TABLE_OUTPUT ------------------------------------------------------------------------------- SQL_ID aa8mzbnrzu42f, child number 0 ------------------------------------- select
count(name) from test where status= :a Plan hash value:
4130896540 -------------------------------------------------------------------------------------- |
Id | Operation | Name | Rows
| Bytes | Cost (%CPU)| Time
| -------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT |
| | |
2 (100)| | | 1 |
SORT AGGREGATE
| | 1 |
25 | | | | 2 |
TABLE ACCESS BY INDEX ROWID| TEST
| 100 | 2500 |
2 (0)| 00:00:01 | |* 3 |
INDEX RANGE SCAN |
T_IND | 100 | |
1 (0)| 00:00:01 | -------------------------------------------------------------------------------------- Outline Data ------------- /*+ BEGIN_OUTLINE_DATA IGNORE_OPTIM_EMBEDDED_HINTS OPTIMIZER_FEATURES_ENABLE('11.2.0.3') DB_VERSION('11.2.0.3') OPT_PARAM('optimizer_dynamic_sampling'
10)
OPT_PARAM('_optimizer_skip_scan_enabled' 'false') ALL_ROWS OUTLINE_LEAF(@"SEL$1") INDEX_RS_ASC(@"SEL$1"
"TEST"@"SEL$1" ("TEST"."STATUS")) END_OUTLINE_DATA */ Predicate
Information (identified by operation id): --------------------------------------------------- 3 - access("STATUS"=:A) Note ----- - SQL plan baseline
SQL_PLAN_636ys750p7z8519ccc485 used for this statement 40 rows selected. Enter value for
hint_text: gather_plan_statistics Profile
profile_aa8mzbnrzu42f_dwrose created. test@DLSP>select
count(name) from test where status= :a; COUNT(NAME) ----------- 100 test@DLSP>select
* from table(dbms_xplan.display_cursor(null,null,'iostats last')); PLAN_TABLE_OUTPUT ------------------------------------------------------------------------------- SQL_ID aa8mzbnrzu42f, child number 0 ------------------------------------- select
count(name) from test where status= :a Plan hash value:
4130896540 ------------------------------------------------------------------------------------------------ |
Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time
| Buffers | ------------------------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | |
1 | | 1
|00:00:00.01 | 102 | | 1 |
SORT AGGREGATE
| | 1 |
1 | 1 |00:00:00.01 | 102 | | 2 |
TABLE ACCESS BY INDEX ROWID| TEST
| 1 | 100 |
100 |00:00:00.01 | 102 | |* 3 |
INDEX RANGE SCAN | T_IND | 1 |
100 | 100 |00:00:00.01 | 2 | ------------------------------------------------------------------------------------------------ Predicate
Information (identified by operation id): --------------------------------------------------- 3 - access("STATUS"=:A) Note ----- - SQL profile profile_aa8mzbnrzu42f_dwrose
used for this statement - SQL plan baseline
SQL_PLAN_636ys750p7z8519ccc485 used for this statement |