You are on page 1of 72

Hotsos Symposium 2005 - The Basics of an Effective Test Environment 1 / 72

SQL> @hstats t
Name Null? Type
----------------------------------------- -------- ----------------------------
PKEY NOT NULL NUMBER
STATUS NUMBER
FLAG CHAR(1)

==========================================================================================
Table Statistics
==========================================================================================
TABLE_NAME : T
LAST_ANALYZED : 04-MAR-2005 11:53:17
DEGREE : 1
PARTITIONED : NO
NUM_ROWS : 100000
CHAIN_CNT : 0
BLOCKS : 207
EMPTY_BLOCKS : 48
AVG_SPACE : 934
AVG_ROW_LEN : 13
MONITORING : NO
SAMPLE_SIZE : 100000
-----------------
==========================================================================================
Column Statistics
==========================================================================================
Name Analyzed Null? NDV Density # Nulls # Buckets Sample Avg Col Len
==========================================================================================
PKEY 03/04/2005 NOT NULL 100000 .000010 0 1 100000 4
STATUS 03/04/2005 3 .333333 0 1 100000 2
FLAG 03/04/2005 2 .500000 0 1 100000 1
==========================================================================================
Index Information
==========================================================================================
INDEX_NAME : SYS_C002345
INDEX_TYPE : NORM
LAST_ANALYZED : 04-MAR-2005 11:53:17
DEGREE : 1
PARTITIONED : NO
BLEVEL : 1
LEAF_BLOCKS : 187
DISTINCT_KEYS : 100000
AVG_LEAF_BLOCKS_PER_KEY : 1
AVG_DATA_BLOCKS_PER_KEY : 1
CLUSTERING_FACTOR : 204
BLOCKS_IN_TABLE : 207
ROWS_IN_TABLE : 100000

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 2 / 72

-----------------
INDEX_NAME : T_N1
INDEX_TYPE : NORM
LAST_ANALYZED : 04-MAR-2005 11:53:17
DEGREE : 1
PARTITIONED : NO
BLEVEL : 1
LEAF_BLOCKS : 238
DISTINCT_KEYS : 3
AVG_LEAF_BLOCKS_PER_KEY : 79
AVG_DATA_BLOCKS_PER_KEY : 68
CLUSTERING_FACTOR : 204
BLOCKS_IN_TABLE : 207
ROWS_IN_TABLE : 100000
-----------------
INDEX_NAME : T_N2
INDEX_TYPE : NORM
LAST_ANALYZED : 04-MAR-2005 11:53:17
DEGREE : 1
PARTITIONED : NO
BLEVEL : 1
LEAF_BLOCKS : 293
DISTINCT_KEYS : 2
AVG_LEAF_BLOCKS_PER_KEY : 146
AVG_DATA_BLOCKS_PER_KEY : 204
CLUSTERING_FACTOR : 408
BLOCKS_IN_TABLE : 207
ROWS_IN_TABLE : 100000
-----------------
INDEX_NAME : T_N3
INDEX_TYPE : NORM
LAST_ANALYZED : 04-MAR-2005 11:53:17
DEGREE : 1
PARTITIONED : NO
BLEVEL : 1
LEAF_BLOCKS : 355
DISTINCT_KEYS : 6
AVG_LEAF_BLOCKS_PER_KEY : 59
AVG_DATA_BLOCKS_PER_KEY : 68
CLUSTERING_FACTOR : 410
BLOCKS_IN_TABLE : 207
ROWS_IN_TABLE : 100000
-----------------
==========================================================================================
Index Columns Information
==========================================================================================
Index Name Pos# Order Column Name Expression
==========================================================================================

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 3 / 72

SYS_C002345 1 ASC PKEY

T_N1 1 ASC STATUS

T_N2 1 ASC FLAG

T_N3 1 ASC STATUS


2 ASC FLAG

SQL>
SQL>
SQL>
SQL> @hstats flags
Name Null? Type
----------------------------------------- -------- ----------------------------
FLAG NOT NULL CHAR(1)

==========================================================================================
Table Statistics
==========================================================================================
TABLE_NAME : FLAGS
LAST_ANALYZED : 04-MAR-2005 10:58:41
DEGREE : 1
PARTITIONED : NO
NUM_ROWS : 5
CHAIN_CNT : 0
BLOCKS :
EMPTY_BLOCKS :
AVG_SPACE :
AVG_ROW_LEN : 4
MONITORING : NO
SAMPLE_SIZE : 5
-----------------
==========================================================================================
Column Statistics
==========================================================================================
Name Analyzed Null? NDV Density # Nulls # Buckets Sample Avg Col Len
==========================================================================================
FLAG 03/04/2005 NOT NULL 5 .200000 0 1 5 1
==========================================================================================
Index Information
==========================================================================================
INDEX_NAME : SYS_IOT_TOP_29235
INDEX_TYPE : IOT
LAST_ANALYZED : 04-MAR-2005 10:58:41
DEGREE : 1
PARTITIONED : NO

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 4 / 72

BLEVEL : 0
LEAF_BLOCKS : 1
DISTINCT_KEYS : 5
AVG_LEAF_BLOCKS_PER_KEY : 1
AVG_DATA_BLOCKS_PER_KEY : 1
CLUSTERING_FACTOR : 0
BLOCKS_IN_TABLE :
ROWS_IN_TABLE : 5
-----------------
==========================================================================================
Index Columns Information
==========================================================================================
Index Name Pos# Order Column Name Expression
==========================================================================================

SYS_IOT_TOP_29235 1 ASC FLAG

SQL> @hix t
Index Flags Height Column Name
------------------------------ ------- ------ ------------------------------
SYS_C002345 U 2 PKEY
T_N1 2 STATUS
T_N2 2 FLAG
T_N3 2 STATUS
. FLAG
SQL>
SQL> @hix flags
Index Flags Height Column Name
------------------------------ ------- ------ ------------------------------
SYS_IOT_TOP_29235 U 1 FLAG

SQL>
SQL> @hcons t

Type Constraint # Column Constraint Rule Refers To


----------- ----------------------- -- ---------- ---------------------- ---------------
Primary Key T.SYS_C002345 1 PKEY

SQL> @hcons flags

Type Constraint # Column Constraint Rule Refers To


----------- ----------------------- -- ---------- ---------------------- ---------------
Primary Key FLAGS.SYS_IOT_TOP_29235 1 FLAG

SQL> get test

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 5 / 72

1 update t
2 set flag='B'
3* where status=2
SQL>
SQL>
SQL> @hds
TableOwner[OP] :
TableName : t
ColumnList : flag, status
WhereClause:
PageSize[30] :

Table blocks below hwm Table rows


(B) (R)
---------------------- ----------------
208 100,000
More:

Block selectivity Block count Row selectivity Row count


F STATUS (pb = b/B) (b) (pr = r/R) (r)
- ---------- ----------------- -------------- ----------------- ----------------
A 2 79.81% 166 1.60% 1,600
B 2 79.81% 166 78.40% 78,400
A 1 10.58% 22 0.20% 200
B 1 10.58% 22 9.80% 9,800
A 0 8.65% 18 0.20% 200
B 0 8.65% 18 9.80% 9,800
SQL>
SQL>
SQL>
SQL> select count(*) from t where status = '2' ;

COUNT(*)
----------
80000

1 row selected.

SQL>
SQL> select count(*) from t where status = '2' and flag = 'B' ;

COUNT(*)
----------
78400

1 row selected.

SQL>

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 6 / 72

SQL>
SQL> @dodml
Enter .sql file name (without extension): test
Enter the workspace name: update
Enter the scenario name: problem
Display results of SQL (ON/OFF)?: off

Capturing statistics information...


=================================================================
Name of 10046 trace file: hotsos_ora_3364.trc
=================================================================

Explain Plan for Scenario update:problem

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 33333 | 99999 | 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 33333 | 99999 | 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2)

Note: cpu costing is off


=================================================================
Name of 10053 trace file: hotsos_ora_1988.trc
=================================================================

Actual Plan for Scenario update:problem

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=563 r=651 w=0 time=5998399 us)'
STAT #1 id=2 cnt=80000 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=200 w=0 time=480438 us)'
SQL>
SQL>
SQL> @lsscstat

List of values (Workspace)


------------------------------------------------------------
UPDATE

Workspace []: update

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 7 / 72

List of values (Scenario)


------------------------------------------------------------
PROBLEM

Scenario []: problem

Statistic Name
Statistic Type (S=stat, L=Latch) Value
---------------------------------------- - --------------
active checkpoint queue latch L 10
cache buffer handles L 54
channel operations parent latch L 4
checkpoint queue latch L 6,935
child cursor hash table L 15
Consistent RBA L 66
dml lock allocation L 7
FIB s.o chain latch L 4
FOB s.o list latch L 4
hash table column usage latch L 4
lgwr LWN SCN L 66
library cache pin allocation L 90
list of block allocation L 7
messages L 258
mostly latch-free SCN L 66
multiblock read objects L 48
post/wait queue L 38
redo writing L 216
session allocation L 2
session idle bit L 17
session timer L 2
sim partition latch L 20
simulator hash latch L 5,867
simulator lru latch L 206
SQL memory manager latch L 2
SQL memory manager workarea list latch L 134
transaction allocation L 1
undo global data L 693
active txn count during cleanout S 2
buffer is not pinned count S 244
bytes received via SQL*Net from client S 1,123
bytes sent via SQL*Net to client S 709
calls to get snapshot scn: kcmgss S 340
calls to kcmgas S 542
change write time S 65
cleanout - number of ktugct calls S 150
cluster key scan block gets S 4

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 8 / 72

cluster key scans S 2


commit cleanouts S 452
commit cleanouts successfully completed S 452
commit txn count during cleanout S 150
consistent changes S 2
consistent gets - examination S 155
CPU used by this session S 175
CPU used when call started S 175
CR blocks created S 2
data blocks consistent reads - undo S 2
records applied

db block changes S 177,204


deferred (CURRENT) block cleanout S 2
applications

dirty buffers inspected S 2,309


enqueue releases S 213
enqueue requests S 215
free buffer inspected S 2,819
free buffer requested S 2,339
hot buffers moved to head of LRU S 139
immediate (CURRENT) block cleanout S 450
applications

index fetch by key S 2


index scans kdiixs1 S 11
leaf node splits S 150
messages sent S 63
no work - consistent read gets S 231
opened cursors cumulative S 18
pinned buffers inspected S 60
prefetched blocks S 176
prefetched blocks aged out before use S 57
recursive calls S 121
redo buffer allocation retries S 2
redo entries S 88,288
redo log space requests S 2
redo log space wait time S 41
redo ordering marks S 132
rollbacks only - consistent read gets S 2
session pga memory S 16,336
shared hash latch upgrades - no wait S 11
SQL*Net roundtrips to/from client S 5
switch current to new buffer S 150
table scans (long tables) S 1
user calls S 8
write clones created in foreground S 107

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 9 / 72

buffer pool L 0
cache buffers chains L 480,644
cache buffers lru chain L 6,850
enqueue hash chains L 444
enqueues L 126
library cache L 282
library cache pin L 178
redo allocation L 88,471
redo copy L 88,333
row cache enqueue latch L 204
row cache objects L 219
shared pool L 193

execute count S 18
parse count (hard) S 2
parse count (total) S 18
redo size S 22,887,828
table fetch by rowid S 11
table scan blocks gotten S 207
table scan rows gotten S 100,000

buffer is pinned count S 0


consistent gets S 563
db block gets S 96,896
physical reads S 651
physical writes S 0
session logical reads S 97,459
sorts (disk) S 0
sorts (memory) S 0
sorts (rows) S 0

elapsed time (centiseconds) S 621

Actual Plan for Scenario UPDATE:PROBLEM

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=563 r=651 w=0 time=5998399 us)'
STAT #1 id=2 cnt=80000 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=200 w=0 time=480438 us)'

SQL>
SQL>
SQL>
SQL> @hopttrace
Enter the workspace name: update
Enter the scenario name: problem

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 10 / 72

Dump file e:\oracle\admin\hotsos\udump\hotsos_ora_1988.trc


Fri Mar 04 11:01:50 2005
ORACLE V9.2.0.6.0 - Production vsnsta=0
vsnsql=12 vsnxtr=3
Windows 2000 Version 5.1 Service Pack 2, CPU type 586
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
Windows 2000 Version 5.1 Service Pack 2, CPU type 586
Instance name: hotsos

Redo thread mounted by this instance: 1

Oracle process number: 13

Windows thread id: 1988, image: ORACLE.EXE

*** SESSION ID:(7.214) 2005-03-04 11:01:50.148


***************************************
PARAMETERS USED BY THE OPTIMIZER
********************************
OPTIMIZER_FEATURES_ENABLE = 9.2.0
OPTIMIZER_MODE/GOAL = Choose
_OPTIMIZER_PERCENT_PARALLEL = 101
HASH_AREA_SIZE = 4194304
HASH_JOIN_ENABLED = TRUE
HASH_MULTIBLOCK_IO_COUNT = 0
SORT_AREA_SIZE = 2097152
OPTIMIZER_SEARCH_LIMIT = 5
PARTITION_VIEW_ENABLED = FALSE
_ALWAYS_STAR_TRANSFORMATION = FALSE
_B_TREE_BITMAP_PLANS = TRUE
STAR_TRANSFORMATION_ENABLED = FALSE
_COMPLEX_VIEW_MERGING = TRUE
_PUSH_JOIN_PREDICATE = TRUE
PARALLEL_BROADCAST_ENABLED = TRUE
OPTIMIZER_MAX_PERMUTATIONS = 2000
OPTIMIZER_INDEX_CACHING = 50
_SYSTEM_INDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 50
OPTIMIZER_DYNAMIC_SAMPLING = 1
_OPTIMIZER_DYN_SMP_BLKS = 32
QUERY_REWRITE_ENABLED = TRUE
QUERY_REWRITE_INTEGRITY = ENFORCED
_INDEX_JOIN_ENABLED = TRUE
_SORT_ELIMINATION_COST_RATIO = 0
_OR_EXPAND_NVL_PREDICATE = TRUE

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 11 / 72

_NEW_INITIAL_JOIN_ORDERS = TRUE
ALWAYS_ANTI_JOIN = CHOOSE
ALWAYS_SEMI_JOIN = CHOOSE
_OPTIMIZER_MODE_FORCE = TRUE
_OPTIMIZER_UNDO_CHANGES = FALSE
_UNNEST_SUBQUERY = TRUE
_PUSH_JOIN_UNION_VIEW = TRUE
_FAST_FULL_SCAN_ENABLED = TRUE
_OPTIM_ENHANCE_NNULL_DETECTION = TRUE
_ORDERED_NESTED_LOOP = TRUE
_NESTED_LOOP_FUDGE = 100
_NO_OR_EXPANSION = FALSE
_QUERY_COST_REWRITE = TRUE
QUERY_REWRITE_EXPRESSION = TRUE
_IMPROVED_ROW_LENGTH_ENABLED = TRUE
_USE_NOSEGMENT_INDEXES = FALSE
_ENABLE_TYPE_DEP_SELECTIVITY = TRUE
_IMPROVED_OUTERJOIN_CARD = TRUE
_OPTIMIZER_ADJUST_FOR_NULLS = TRUE
_OPTIMIZER_CHOOSE_PERMUTATION = 0
_USE_COLUMN_STATS_FOR_FUNCTION = TRUE
_SUBQUERY_PRUNING_ENABLED = TRUE
_SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
_SUBQUERY_PRUNING_COST_FACTOR = 20
_LIKE_WITH_BIND_AS_EQUALITY = FALSE
_TABLE_SCAN_COST_PLUS_ONE = TRUE
_SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
_DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
_ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
_OPTIMIZER_COST_MODEL = CHOOSE
_GSETS_ALWAYS_USE_TEMPTABLES = FALSE
DB_FILE_MULTIBLOCK_READ_COUNT = 16
_NEW_SORT_COST_ESTIMATE = TRUE
_GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
_CPU_TO_IO = 0
_PRED_MOVE_AROUND = TRUE
***************************************
BASE STATISTICAL INFORMATION
***********************
Table stats Table: T Alias: T
TOTAL :: CDN: 100000 NBLKS: 207 AVG_ROW_LEN: 13
-- Index stats
INDEX NAME: SYS_C002345 COL#: 1
TOTAL :: LVLS: 1 #LB: 187 #DK: 100000 LB/K: 1 DB/K: 1 CLUF: 204
INDEX NAME: T_N1 COL#: 2
TOTAL :: LVLS: 1 #LB: 238 #DK: 3 LB/K: 79 DB/K: 68 CLUF: 204
INDEX NAME: T_N2 COL#: 3
TOTAL :: LVLS: 1 #LB: 225 #DK: 2 LB/K: 112 DB/K: 204 CLUF: 408

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 12 / 72

INDEX NAME: T_N3 COL#: 2 3


TOTAL :: LVLS: 1 #LB: 273 #DK: 6 LB/K: 45 DB/K: 68 CLUF: 410
_OPTIMIZER_PERCENT_PARALLEL = 0
***************************************
SINGLE TABLE ACCESS PATH
Column: STATUS Col#: 2 Table: T Alias: T
NDV: 3 NULLS: 0 DENS: 3.3333e-001 LO: 0 HI: 2
NO HISTOGRAM: #BKT: 1 #VAL: 2
TABLE: T ORIG CDN: 100000 ROUNDED CDN: 33333 CMPTD CDN: 33333
Access path: tsc Resc: 22 Resp: 22
Access path: index (equal)
Index: T_N1
TABLE: T
RSC_CPU: 0 RSC_IO: 148
IX_SEL: 0.0000e+000 TB_SEL: 3.3333e-001
Skip scan: ss-sel 0 andv 2
ss cost 92
index io scan cost 0
Access path: index (index-only)
Index: T_N3
TABLE: T
RSC_CPU: 0 RSC_IO: 92
IX_SEL: 3.3333e-001 TB_SEL: 3.3333e-001
BEST_CST: 22.00 PATH: 2 Degree: 1
***************************************
OPTIMIZER STATISTICS AND COMPUTATIONS
***************************************
GENERAL PLANS
***********************
Join order[1]: T[T]#0
Best so far: TABLE#: 0 CST: 22 CDN: 33333 BYTES: 99999
Final - All Rows Plan:
JOIN ORDER: 1
CST: 22 CDN: 33333 RSC: 22 RSP: 22 BYTES: 99999
IO-RSC: 22 IO-RSP: 22 CPU-RSC: 0 CPU-RSP: 0
QUERY
explain plan set statement_id='update:problem' for
update t
set flag='B'
where status=2
PLAN
Cost of plan: 22
Operation...........Object name.....Options.........Id...Pid..
UPDATE STATEMENT 0
UPDATE T 1
TABLE ACCESS T FULL 2 1
QUERY
alter session set events '10053 trace name context off'

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 13 / 72

SQL>
SQL>
SQL>
SQL>
SQL>

SQL> @horatrace
Enter the workspace name: update
Enter the scenario name: problem
Review tkprof output? (Y/N): Y
Your trace file (hotsos_ora_3364.trc) has been spooled to your default directory.

Tkprof output will be displayed first (if requested).

hotsos_ora_3364.trc will be displayed in your editor after any tkprof output.

Press Enter to continue. . .

TKPROF: Release 9.2.0.6.0 - Production on Fri Mar 4 11:29:18 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Trace file: hotsos_ora_3364.trc


Sort options: default
. . .
. . .
update t
set flag='B'
where status=2

call count cpu elapsed disk query current rows


------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 1.73 6.00 651 563 96896 80000
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 1.73 6.00 651 563 96896 80000

Misses in library cache during parse: 1


Optimizer goal: CHOOSE
Parsing user id: 41

Rows Row Source Operation


------- ---------------------------------------------------
0 UPDATE (cr=563 r=651 w=0 time=5998399 us)
80000 TABLE ACCESS FULL T (cr=211 r=200 w=0 time=480438 us)
. . .
. . .

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 14 / 72

Dump file e:\oracle\admin\hotsos\udump\hotsos_ora_3364.trc


. . .
. . .
PARSING IN CURSOR #1 len=40 dep=0 uid=41 oct=6 lid=41 tim=90089340242 hv=1483413068 ad='2bf70aac'
update t
set flag='B'
where status=2
END OF STMT
PARSE #1:c=0,e=1509,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=90089340234
. . .
. . .
EXEC #1:c=1734375,e=6000464,p=651,cr=563,cu=96896,mis=0,r=80000,dep=0,og=4,tim=90095354755
. . .
. . .

SQL>
SQL>
SQL>
SQL>
SQL> get test_ans1
1 update t
2 set flag='B'
3 where status=2
4* and flag != 'B'
SQL>
SQL>
SQL> @dodml
Enter .sql file name (without extension): test_ans1
Enter the workspace name: update
Enter the scenario name: answer1
Display results of SQL (ON/OFF)?: off

Capturing statistics information...


=================================================================
Name of 10046 trace file: hotsos_ora_1256.trc
=================================================================

Explain Plan for Scenario update:answer1

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 16667 | 50001 | 22 |

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 15 / 72

| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 16667 | 50001 | 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2 AND "T"."FLAG"<>'B')

Note: cpu costing is off


=================================================================
Name of 10053 trace file: hotsos_ora_1292.trc
=================================================================

Actual Plan for Scenario update:answer1

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=215 r=717 w=0 time=2217354 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=205 w=0 time=277281 us)'
SQL>
SQL>
SQL> @lsscstat

List of values (Workspace)


------------------------------------------------------------
UPDATE

Workspace [UPDATE]:

List of values (Scenario)


------------------------------------------------------------
ANSWER1
PROBLEM

Scenario [PROBLEM]: answer1

Statistic Name
Statistic Type (S=stat, L=Latch) Value
---------------------------------------- - --------------
active checkpoint queue latch L 4
channel operations parent latch L 2
checkpoint queue latch L 2,357
child cursor hash table L 15
Consistent RBA L 5
dml lock allocation L 3
hash table column usage latch L 6

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 16 / 72

lgwr LWN SCN L 5


library cache pin allocation L 42
list of block allocation L 6
messages L 31
mostly latch-free SCN L 5
multiblock read objects L 48
post/wait queue L 4
redo writing L 21
session allocation L 2
session idle bit L 17
sim partition latch L 2
simulator hash latch L 464
simulator lru latch L 91
SQL memory manager latch L 1
SQL memory manager workarea list latch L 67
undo global data L 10
buffer is not pinned count S 210
bytes received via SQL*Net from client S 1,142
bytes sent via SQL*Net to client S 709
calls to get snapshot scn: kcmgss S 9
calls to kcmgas S 178
CPU used by this session S 33
CPU used when call started S 33
db block changes S 16,111
dirty buffers inspected S 835
enqueue releases S 4
enqueue requests S 6
free buffer inspected S 898
free buffer requested S 981
hot buffers moved to head of LRU S 365
index scans kdiixs1 S 1
messages sent S 6
no work - consistent read gets S 209
opened cursors cumulative S 6
pinned buffers inspected S 36
prefetched blocks S 181
prefetched blocks aged out before use S 25
recursive calls S 8
redo entries S 8,011
session pga memory S 189,544
shared hash latch upgrades - no wait S 1
SQL*Net roundtrips to/from client S 5
switch current to new buffer S 166
table scans (long tables) S 1
user calls S 8
write clones created in foreground S 12

buffer pool L 0

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 17 / 72

cache buffers chains L 65,004


cache buffers lru chain L 2,507
enqueue hash chains L 16
enqueues L 11
library cache L 150
library cache pin L 82
redo allocation L 8,038
redo copy L 8,028
row cache enqueue latch L 58
row cache objects L 61
shared pool L 136

execute count S 6
parse count (hard) S 2
parse count (total) S 6
redo size S 1,633,416
table fetch by rowid S 1
table scan blocks gotten S 207
table scan rows gotten S 100,000

buffer is pinned count S 0


consistent gets S 215
db block gets S 14,585
physical reads S 717
physical writes S 0
session logical reads S 14,800
sorts (disk) S 0
sorts (memory) S 0
sorts (rows) S 0

elapsed time (centiseconds) S 234

Actual Plan for Scenario UPDATE:ANSWER1

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=215 r=717 w=0 time=2217354 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=205 w=0 time=277281 us)'

SQL>
SQL>
SQL>
SQL> @diff

List of values (First workspace)


------------------------------------------------------------
UPDATE

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 18 / 72

First workspace []: update

List of values (First scenario)


------------------------------------------------------------
ANSWER1
PROBLEM

First scenario []: problem

List of values (Second workspace)


------------------------------------------------------------
UPDATE

Second workspace []: update

List of values (Second scenario)


------------------------------------------------------------
ANSWER1
PROBLEM

Second scenario []: answer1

Statistic Name UPDATE UPDATE


Statistic Type (S=stat, L=Latch) PROBLEM ANSWER1 Difference
---------------------------------------- - -------------- -------------- --------------
active checkpoint queue latch L 10 4 -6
cache buffer handles L 54 0 -54
channel operations parent latch L 4 2 -2
checkpoint queue latch L 6,935 2,357 -4,578
Consistent RBA L 66 5 -61
dml lock allocation L 7 3 -4
FIB s.o chain latch L 4 0 -4
FOB s.o list latch L 4 0 -4
hash table column usage latch L 4 6 2
lgwr LWN SCN L 66 5 -61
library cache pin allocation L 90 42 -48
list of block allocation L 7 6 -1
messages L 258 31 -227
mostly latch-free SCN L 66 5 -61
post/wait queue L 38 4 -34
redo writing L 216 21 -195
session timer L 2 0 -2
sim partition latch L 20 2 -18
simulator hash latch L 5,867 464 -5,403

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 19 / 72

simulator lru latch L 206 91 -115


SQL memory manager latch L 2 1 -1
SQL memory manager workarea list latch L 134 67 -67
transaction allocation L 1 0 -1
undo global data L 693 10 -683
active txn count during cleanout S 2 0 -2
buffer is not pinned count S 244 210 -34
bytes received via SQL*Net from client S 1,123 1,142 19
calls to get snapshot scn: kcmgss S 340 9 -331
calls to kcmgas S 542 178 -364
change write time S 65 0 -65
cleanout - number of ktugct calls S 150 0 -150
cluster key scan block gets S 4 0 -4
cluster key scans S 2 0 -2
commit cleanouts S 452 0 -452
commit cleanouts successfully completed S 452 0 -452
commit txn count during cleanout S 150 0 -150
consistent changes S 2 0 -2
consistent gets - examination S 155 0 -155
CPU used by this session S 175 33 -142
CPU used when call started S 175 33 -142
CR blocks created S 2 0 -2
data blocks consistent reads - undo S 2 0 -2
records applied

db block changes S 177,204 16,111 -161,093


deferred (CURRENT) block cleanout S 2 0 -2
applications

dirty buffers inspected S 2,309 835 -1,474


enqueue releases S 213 4 -209
enqueue requests S 215 6 -209
free buffer inspected S 2,819 898 -1,921
free buffer requested S 2,339 981 -1,358
hot buffers moved to head of LRU S 139 365 226
immediate (CURRENT) block cleanout S 450 0 -450
applications

index fetch by key S 2 0 -2


index scans kdiixs1 S 11 1 -10
leaf node splits S 150 0 -150
messages sent S 63 6 -57
no work - consistent read gets S 231 209 -22
opened cursors cumulative S 18 6 -12
pinned buffers inspected S 60 36 -24
prefetched blocks S 176 181 5
prefetched blocks aged out before use S 57 25 -32
recursive calls S 121 8 -113

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 20 / 72

redo buffer allocation retries S 2 0 -2


redo entries S 88,288 8,011 -80,277
redo log space requests S 2 0 -2
redo log space wait time S 41 0 -41
redo ordering marks S 132 0 -132
rollbacks only - consistent read gets S 2 0 -2
session pga memory S 16,336 189,544 173,208
shared hash latch upgrades - no wait S 11 1 -10
switch current to new buffer S 150 166 16
write clones created in foreground S 107 12 -95

buffer pool L 0 0 0
cache buffers chains L 480,644 65,004 -415,640
cache buffers lru chain L 6,850 2,507 -4,343
enqueue hash chains L 444 16 -428
enqueues L 126 11 -115
library cache L 282 150 -132
library cache pin L 178 82 -96
redo allocation L 88,471 8,038 -80,433
redo copy L 88,333 8,028 -80,305
row cache enqueue latch L 204 58 -146
row cache objects L 219 61 -158
shared pool L 193 136 -57

execute count S 18 6 -12


parse count (hard) S 2 2 0
parse count (total) S 18 6 -12
redo size S 22,887,828 1,633,416 -21,254,412
table fetch by rowid S 11 1 -10
table scan blocks gotten S 207 207 0
table scan rows gotten S 100,000 100,000 0

buffer is pinned count S 0 0 0


consistent gets S 563 215 -348
db block gets S 96,896 14,585 -82,311
physical reads S 651 717 66
physical writes S 0 0 0
session logical reads S 97,459 14,800 -82,659
sorts (disk) S 0 0 0
sorts (memory) S 0 0 0
sorts (rows) S 0 0 0

elapsed time S 621 234 -387

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 21 / 72

elapsed time (in seconds) S 6.21 2.34 -3.87

List of values (Show actual 10046 STAT lines)


------------------------------------------------------------
YES
NO

Show actual 10046 STAT lines [YES]:

Actual Plan for Scenario UPDATE:PROBLEM

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=563 r=651 w=0 time=5998399 us)'
STAT #1 id=2 cnt=80000 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=200 w=0 time=480438 us)'

Actual Plan for Scenario UPDATE:ANSWER1

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=215 r=717 w=0 time=2217354 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=205 w=0 time=277281 us)'

List of values (Show EXPLAIN PLAN output)


------------------------------------------------------------
YES
NO

Show EXPLAIN PLAN output [YES]:

==========================================================================
UPDATE:PROBLEM

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 33333 | 99999 | 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 33333 | 99999 | 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2)

Note: cpu costing is off

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 22 / 72

==========================================================================
UPDATE:ANSWER1

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 16667 | 50001 | 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 16667 | 50001 | 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2 AND "T"."FLAG"<>'B')

Note: cpu costing is off


==========================================================================

SQL>
SQL> get test_ans2
1 update t
2 set flag='B'
3 where status=2
4* and flag in (select flag from flags minus select 'B' from dual )
SQL>
SQL>
SQL> @dodml
Enter .sql file name (without extension): test_ans2
Enter the workspace name: update
Enter the scenario name: answer2
Display results of SQL (ON/OFF)?: off

Capturing statistics information...


=================================================================
Name of 10046 trace file: hotsos_ora_3532.trc
=================================================================

Explain Plan for Scenario update:answer2

----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 83333 | 488K| 26 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 83333 | 488K| 26 |
| 3 | VIEW | VW_NSO_1 | 5 | 15 | 25 |

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 23 / 72

| 4 | MINUS | | | | |
| 5 | SORT UNIQUE | | 5 | 5 | |
| 6 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 5 | 5 | 1 |
| 7 | TABLE ACCESS FULL| DUAL | 8168 | | 11 |
|* 8 | INDEX RANGE SCAN | T_N3 | 16667 | 50001 | |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

8 - access("T"."STATUS"=2 AND "T"."FLAG"="VW_NSO_1"."$nso_col_1")

Note: cpu costing is off


=================================================================
Name of 10053 trace file: hotsos_ora_2552.trc
=================================================================

Actual Plan for Scenario update:answer2

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=494 w=0 time=1203620 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=3 w=0 time=40684 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=15222 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=15205 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=15077 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=14973 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=84 us)'
STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=2 w=0 time=18340 us)'
SQL>
SQL>
SQL> @lsscstat

List of values (Workspace)


------------------------------------------------------------
UPDATE

Workspace [UPDATE]:

List of values (Scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
PROBLEM

Scenario [ANSWER1]: answer2

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 24 / 72

Statistic Name
Statistic Type (S=stat, L=Latch) Value
---------------------------------------- - --------------
active checkpoint queue latch L 4
channel operations parent latch L 2
checkpoint queue latch L 1,641
child cursor hash table L 15
Consistent RBA L 4
dml lock allocation L 3
hash table column usage latch L 10
lgwr LWN SCN L 4
library cache load lock L 2
library cache pin allocation L 58
list of block allocation L 6
messages L 25
mostly latch-free SCN L 4
post/wait queue L 2
redo writing L 18
session allocation L 2
session idle bit L 17
session timer L 1
sim partition latch L 1
simulator hash latch L 258
simulator lru latch L 62
SQL memory manager latch L 1
SQL memory manager workarea list latch L 71
undo global data L 6
buffer is not pinned count S 2
bytes received via SQL*Net from client S 1,191
bytes sent via SQL*Net to client S 709
calls to get snapshot scn: kcmgss S 8
calls to kcmgas S 4
consistent gets - examination S 1
CPU used by this session S 11
CPU used when call started S 11
cursor authentications S 1
db block changes S 4,421
dirty buffers inspected S 538
enqueue releases S 2
enqueue requests S 4
free buffer inspected S 541
free buffer requested S 537
hot buffers moved to head of LRU S 222
index scans kdiixs1 S 9
messages sent S 4
no work - consistent read gets S 7
opened cursors cumulative S 7
parse time cpu S 2

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 25 / 72

parse time elapsed S 13


pinned buffers inspected S 3
recursive calls S 5
recursive cpu usage S 2
redo entries S 2,189
shared hash latch upgrades - no wait S 10
SQL*Net roundtrips to/from client S 5
table scans (short tables) S 1
user calls S 8
workarea executions - optimal S 5
write clones created in foreground S 4

buffer pool L 0
cache buffers chains L 16,101
cache buffers lru chain L 1,434
enqueue hash chains L 12
enqueues L 7
library cache L 208
library cache pin L 100
redo allocation L 2,217
redo copy L 2,209
row cache enqueue latch L 120
row cache objects L 123
shared pool L 180

execute count S 7
parse count (hard) S 2
parse count (total) S 7
redo size S 638,912
table fetch by rowid S 0
table scan blocks gotten S 1
table scan rows gotten S 1

buffer is pinned count S 2


consistent gets S 20
db block gets S 2,840
physical reads S 498
physical writes S 0
session logical reads S 2,860
sorts (disk) S 0
sorts (memory) S 5
sorts (rows) S 6,405

elapsed time (centiseconds) S 151

Actual Plan for Scenario UPDATE:ANSWER2

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 26 / 72

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=494 w=0 time=1203620 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=3 w=0 time=40684 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=15222 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=15205 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=15077 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=14973 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=84 us)'
STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=2 w=0 time=18340 us)'

SQL>
SQL>
SQL>
SQL> @hrank update
Scenario ranking for workspace update by elapsed time

Elapsed Time (secs) Scenario Name


--------------------- --------------------------------------------------------------------------------
1.510000 ANSWER2
2.340000 ANSWER1
6.210000 PROBLEM

SQL>
SQL> @diff

List of values (First workspace)


------------------------------------------------------------
UPDATE

First workspace [UPDATE]:

List of values (First scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
PROBLEM

First scenario [PROBLEM]:

List of values (Second workspace)


------------------------------------------------------------
UPDATE

Second workspace [UPDATE]:

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 27 / 72

List of values (Second scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
PROBLEM

Second scenario [ANSWER1]: answer2

Statistic Name UPDATE UPDATE


Statistic Type (S=stat, L=Latch) PROBLEM ANSWER2 Difference
---------------------------------------- - -------------- -------------- --------------
active checkpoint queue latch L 10 4 -6
cache buffer handles L 54 0 -54
channel operations parent latch L 4 2 -2
checkpoint queue latch L 6,935 1,641 -5,294
Consistent RBA L 66 4 -62
dml lock allocation L 7 3 -4
FIB s.o chain latch L 4 0 -4
FOB s.o list latch L 4 0 -4
hash table column usage latch L 4 10 6
lgwr LWN SCN L 66 4 -62
library cache load lock L 0 2 2
library cache pin allocation L 90 58 -32
list of block allocation L 7 6 -1
messages L 258 25 -233
mostly latch-free SCN L 66 4 -62
multiblock read objects L 48 0 -48
post/wait queue L 38 2 -36
redo writing L 216 18 -198
session timer L 2 1 -1
sim partition latch L 20 1 -19
simulator hash latch L 5,867 258 -5,609
simulator lru latch L 206 62 -144
SQL memory manager latch L 2 1 -1
SQL memory manager workarea list latch L 134 71 -63
transaction allocation L 1 0 -1
undo global data L 693 6 -687
active txn count during cleanout S 2 0 -2
buffer is not pinned count S 244 2 -242
bytes received via SQL*Net from client S 1,123 1,191 68
calls to get snapshot scn: kcmgss S 340 8 -332
calls to kcmgas S 542 4 -538
change write time S 65 0 -65
cleanout - number of ktugct calls S 150 0 -150
cluster key scan block gets S 4 0 -4
cluster key scans S 2 0 -2
commit cleanouts S 452 0 -452

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 28 / 72

commit cleanouts successfully completed S 452 0 -452


commit txn count during cleanout S 150 0 -150
consistent changes S 2 0 -2
consistent gets - examination S 155 1 -154
CPU used by this session S 175 11 -164
CPU used when call started S 175 11 -164
CR blocks created S 2 0 -2
cursor authentications S 0 1 1
data blocks consistent reads - undo S 2 0 -2
records applied

db block changes S 177,204 4,421 -172,783


deferred (CURRENT) block cleanout S 2 0 -2
applications

dirty buffers inspected S 2,309 538 -1,771


enqueue releases S 213 2 -211
enqueue requests S 215 4 -211
free buffer inspected S 2,819 541 -2,278
free buffer requested S 2,339 537 -1,802
hot buffers moved to head of LRU S 139 222 83
immediate (CURRENT) block cleanout S 450 0 -450
applications

index fetch by key S 2 0 -2


index scans kdiixs1 S 11 9 -2
leaf node splits S 150 0 -150
messages sent S 63 4 -59
no work - consistent read gets S 231 7 -224
opened cursors cumulative S 18 7 -11
parse time cpu S 0 2 2
parse time elapsed S 0 13 13
pinned buffers inspected S 60 3 -57
prefetched blocks S 176 0 -176
prefetched blocks aged out before use S 57 0 -57
recursive calls S 121 5 -116
recursive cpu usage S 0 2 2
redo buffer allocation retries S 2 0 -2
redo entries S 88,288 2,189 -86,099
redo log space requests S 2 0 -2
redo log space wait time S 41 0 -41
redo ordering marks S 132 0 -132
rollbacks only - consistent read gets S 2 0 -2
session pga memory S 16,336 0 -16,336
shared hash latch upgrades - no wait S 11 10 -1
switch current to new buffer S 150 0 -150
table scans (long tables) S 1 0 -1
table scans (short tables) S 0 1 1

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 29 / 72

workarea executions - optimal S 0 5 5


write clones created in foreground S 107 4 -103

buffer pool L 0 0 0
cache buffers chains L 480,644 16,101 -464,543
cache buffers lru chain L 6,850 1,434 -5,416
enqueue hash chains L 444 12 -432
enqueues L 126 7 -119
library cache L 282 208 -74
library cache pin L 178 100 -78
redo allocation L 88,471 2,217 -86,254
redo copy L 88,333 2,209 -86,124
row cache enqueue latch L 204 120 -84
row cache objects L 219 123 -96
shared pool L 193 180 -13

execute count S 18 7 -11


parse count (hard) S 2 2 0
parse count (total) S 18 7 -11
redo size S 22,887,828 638,912 -22,248,916
table fetch by rowid S 11 0 -11
table scan blocks gotten S 207 1 -206
table scan rows gotten S 100,000 1 -99,999

buffer is pinned count S 0 2 2


consistent gets S 563 20 -543
db block gets S 96,896 2,840 -94,056
physical reads S 651 498 -153
physical writes S 0 0 0
session logical reads S 97,459 2,860 -94,599
sorts (disk) S 0 0 0
sorts (memory) S 0 5 5
sorts (rows) S 0 6,405 6,405

elapsed time S 621 151 -470

elapsed time (in seconds) S 6.21 1.51 -4.70

List of values (Show actual 10046 STAT lines)


------------------------------------------------------------
YES
NO

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 30 / 72

Show actual 10046 STAT lines [YES]:

Actual Plan for Scenario UPDATE:PROBLEM

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=563 r=651 w=0 time=5998399 us)'
STAT #1 id=2 cnt=80000 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=200 w=0 time=480438 us)'

Actual Plan for Scenario UPDATE:ANSWER2

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=494 w=0 time=1203620 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=3 w=0 time=40684 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=15222 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=15205 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=15077 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=14973 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=84 us)'
STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=2 w=0 time=18340 us)'

List of values (Show EXPLAIN PLAN output)


------------------------------------------------------------
YES
NO

Show EXPLAIN PLAN output [YES]:

==========================================================================
UPDATE:PROBLEM

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 33333 | 99999 | 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 33333 | 99999 | 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2)

Note: cpu costing is off

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 31 / 72

==========================================================================
UPDATE:ANSWER2

----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 83333 | 488K| 26 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 83333 | 488K| 26 |
| 3 | VIEW | VW_NSO_1 | 5 | 15 | 25 |
| 4 | MINUS | | | | |
| 5 | SORT UNIQUE | | 5 | 5 | |
| 6 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 5 | 5 | 1 |
| 7 | TABLE ACCESS FULL| DUAL | 8168 | | 11 |
|* 8 | INDEX RANGE SCAN | T_N3 | 16667 | 50001 | |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

8 - access("T"."STATUS"=2 AND "T"."FLAG"="VW_NSO_1"."$nso_col_1")

Note: cpu costing is off


==========================================================================

SQL>
SQL> @diff

List of values (First workspace)


------------------------------------------------------------
UPDATE

First workspace [UPDATE]:

List of values (First scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
PROBLEM

First scenario [PROBLEM]: answer1

List of values (Second workspace)


------------------------------------------------------------
UPDATE

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 32 / 72

Second workspace [UPDATE]:

List of values (Second scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
PROBLEM

Second scenario [ANSWER2]:

Statistic Name UPDATE UPDATE


Statistic Type (S=stat, L=Latch) ANSWER1 ANSWER2 Difference
---------------------------------------- - -------------- -------------- --------------
checkpoint queue latch L 2,357 1,641 -716
Consistent RBA L 5 4 -1
hash table column usage latch L 6 10 4
lgwr LWN SCN L 5 4 -1
library cache load lock L 0 2 2
library cache pin allocation L 42 58 16
messages L 31 25 -6
mostly latch-free SCN L 5 4 -1
multiblock read objects L 48 0 -48
post/wait queue L 4 2 -2
redo writing L 21 18 -3
session timer L 0 1 1
sim partition latch L 2 1 -1
simulator hash latch L 464 258 -206
simulator lru latch L 91 62 -29
SQL memory manager workarea list latch L 67 71 4
undo global data L 10 6 -4
buffer is not pinned count S 210 2 -208
bytes received via SQL*Net from client S 1,142 1,191 49
calls to get snapshot scn: kcmgss S 9 8 -1
calls to kcmgas S 178 4 -174
consistent gets - examination S 0 1 1
CPU used by this session S 33 11 -22
CPU used when call started S 33 11 -22
cursor authentications S 0 1 1
db block changes S 16,111 4,421 -11,690
dirty buffers inspected S 835 538 -297
enqueue releases S 4 2 -2
enqueue requests S 6 4 -2
free buffer inspected S 898 541 -357
free buffer requested S 981 537 -444
hot buffers moved to head of LRU S 365 222 -143
index scans kdiixs1 S 1 9 8

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 33 / 72

messages sent S 6 4 -2
no work - consistent read gets S 209 7 -202
opened cursors cumulative S 6 7 1
parse time cpu S 0 2 2
parse time elapsed S 0 13 13
pinned buffers inspected S 36 3 -33
prefetched blocks S 181 0 -181
prefetched blocks aged out before use S 25 0 -25
recursive calls S 8 5 -3
recursive cpu usage S 0 2 2
redo entries S 8,011 2,189 -5,822
session pga memory S 189,544 0 -189,544
shared hash latch upgrades - no wait S 1 10 9
switch current to new buffer S 166 0 -166
table scans (long tables) S 1 0 -1
table scans (short tables) S 0 1 1
workarea executions - optimal S 0 5 5
write clones created in foreground S 12 4 -8

buffer pool L 0 0 0
cache buffers chains L 65,004 16,101 -48,903
cache buffers lru chain L 2,507 1,434 -1,073
enqueue hash chains L 16 12 -4
enqueues L 11 7 -4
library cache L 150 208 58
library cache pin L 82 100 18
redo allocation L 8,038 2,217 -5,821
redo copy L 8,028 2,209 -5,819
row cache enqueue latch L 58 120 62
row cache objects L 61 123 62
shared pool L 136 180 44

execute count S 6 7 1
parse count (hard) S 2 2 0
parse count (total) S 6 7 1
redo size S 1,633,416 638,912 -994,504
table fetch by rowid S 1 0 -1
table scan blocks gotten S 207 1 -206
table scan rows gotten S 100,000 1 -99,999

buffer is pinned count S 0 2 2


consistent gets S 215 20 -195
db block gets S 14,585 2,840 -11,745
physical reads S 717 498 -219
physical writes S 0 0 0

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 34 / 72

session logical reads S 14,800 2,860 -11,940


sorts (disk) S 0 0 0
sorts (memory) S 0 5 5
sorts (rows) S 0 6,405 6,405

elapsed time S 234 151 -83

elapsed time (in seconds) S 2.34 1.51 -0.83

List of values (Show actual 10046 STAT lines)


------------------------------------------------------------
YES
NO

Show actual 10046 STAT lines [YES]:

Actual Plan for Scenario UPDATE:ANSWER1

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=215 r=717 w=0 time=2217354 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=205 w=0 time=277281 us)'

Actual Plan for Scenario UPDATE:ANSWER2

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=494 w=0 time=1203620 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=3 w=0 time=40684 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=15222 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=15205 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=15077 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=14973 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=84 us)'
STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=2 w=0 time=18340 us)'

List of values (Show EXPLAIN PLAN output)


------------------------------------------------------------
YES
NO

Show EXPLAIN PLAN output [YES]:

==========================================================================
UPDATE:ANSWER1

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 35 / 72

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 16667 | 50001 | 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 16667 | 50001 | 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2 AND "T"."FLAG"<>'B')

Note: cpu costing is off

==========================================================================
UPDATE:ANSWER2

----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 83333 | 488K| 26 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 83333 | 488K| 26 |
| 3 | VIEW | VW_NSO_1 | 5 | 15 | 25 |
| 4 | MINUS | | | | |
| 5 | SORT UNIQUE | | 5 | 5 | |
| 6 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 5 | 5 | 1 |
| 7 | TABLE ACCESS FULL| DUAL | 8168 | | 11 |
|* 8 | INDEX RANGE SCAN | T_N3 | 16667 | 50001 | |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

8 - access("T"."STATUS"=2 AND "T"."FLAG"="VW_NSO_1"."$nso_col_1")

Note: cpu costing is off


==========================================================================

SQL>
SQL>
SQL> get test_ans3
1 update t
2 set flag='B'
3 where status=2
4* and flag in (select flag from flags where flag != 'B')

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 36 / 72

SQL>
SQL>
SQL> @dodml
Enter .sql file name (without extension): test_ans3
Enter the workspace name: update
Enter the scenario name: answer3
Display results of SQL (ON/OFF)?: off

Capturing statistics information...


=================================================================
Name of 10046 trace file: hotsos_ora_2480.trc
=================================================================

Explain Plan for Scenario update:answer3

---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
---------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 33333 | 130K| 2 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 33333 | 130K| 2 |
|* 3 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 4 | 4 | 1 |
|* 4 | INDEX RANGE SCAN | T_N3 | 8333 | 24999 | |
---------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

3 - filter("FLAGS"."FLAG"<>'B')
4 - access("T"."STATUS"=2 AND "T"."FLAG"="FLAGS"."FLAG")

Note: cpu costing is off


=================================================================
Name of 10053 trace file: hotsos_ora_1200.trc
=================================================================

Actual Plan for Scenario update:answer3

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=12 r=212 w=0 time=666891 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=12 r=2 w=0 time=29875 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=13743 us)'
STAT #1 id=4 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11135 us)'
SQL>
SQL>
SQL> @lsscstat

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 37 / 72

List of values (Workspace)


------------------------------------------------------------
UPDATE

Workspace [UPDATE]:

List of values (Scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
ANSWER3
PROBLEM

Scenario [ANSWER2]: answer3

Statistic Name
Statistic Type (S=stat, L=Latch) Value
---------------------------------------- - --------------
active checkpoint queue latch L 4
checkpoint queue latch L 910
child cursor hash table L 14
Consistent RBA L 3
dml lock allocation L 3
hash table column usage latch L 15
lgwr LWN SCN L 3
library cache pin allocation L 42
list of block allocation L 6
messages L 22
mostly latch-free SCN L 3
redo writing L 13
session idle bit L 16
simulator hash latch L 203
simulator lru latch L 29
SQL memory manager workarea list latch L 4
undo global data L 6
buffer is not pinned count S 1
bytes received via SQL*Net from client S 1,181
bytes sent via SQL*Net to client S 709
calls to get snapshot scn: kcmgss S 3
calls to kcmgas S 1
consistent gets - examination S 1
CPU used by this session S 12
CPU used when call started S 12
db block changes S 4,421
dirty buffers inspected S 2
enqueue releases S 2

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 38 / 72

enqueue requests S 4
free buffer inspected S 2
free buffer requested S 247
hot buffers moved to head of LRU S 303
index scans kdiixs1 S 5
messages sent S 3
no work - consistent read gets S 6
opened cursors cumulative S 5
redo entries S 2,189
shared hash latch upgrades - no wait S 6
SQL*Net roundtrips to/from client S 5
user calls S 8
workarea executions - optimal S 4
write clones created in foreground S 1

buffer pool L 0
cache buffers chains L 13,914
cache buffers lru chain L 504
enqueue hash chains L 10
enqueues L 4
library cache L 156
library cache pin L 78
redo allocation L 2,212
redo copy L 2,206
row cache enqueue latch L 74
row cache objects L 77
shared pool L 152

execute count S 5
parse count (hard) S 2
parse count (total) S 5
redo size S 638,912
table fetch by rowid S 0
table scan blocks gotten S 0
table scan rows gotten S 0

buffer is pinned count S 2


consistent gets S 12
db block gets S 2,840
physical reads S 212
physical writes S 0
session logical reads S 2,852
sorts (disk) S 0
sorts (memory) S 2
sorts (rows) S 6,400

elapsed time (centiseconds) S 102

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 39 / 72

Actual Plan for Scenario UPDATE:ANSWER3

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=12 r=212 w=0 time=666891 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=12 r=2 w=0 time=29875 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=13743 us)'
STAT #1 id=4 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11135 us)'

SQL>
SQL>
SQL>
SQL> @hrank update

Scenario ranking for workspace update by elapsed time

Elapsed Time (secs) Scenario Name


--------------------- --------------------------------------------------------------------------------
1.020000 ANSWER3
1.510000 ANSWER2
2.340000 ANSWER1
6.210000 PROBLEM

SQL> @diff

List of values (First workspace)


------------------------------------------------------------
UPDATE

First workspace [UPDATE]:

List of values (First scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
ANSWER3
PROBLEM

First scenario [ANSWER1]: problem

List of values (Second workspace)


------------------------------------------------------------
UPDATE

Second workspace [UPDATE]:

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 40 / 72

List of values (Second scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
ANSWER3
PROBLEM

Second scenario [ANSWER2]: answer3

Statistic Name UPDATE UPDATE


Statistic Type (S=stat, L=Latch) PROBLEM ANSWER3 Difference
---------------------------------------- - -------------- -------------- --------------
active checkpoint queue latch L 10 4 -6
cache buffer handles L 54 0 -54
channel operations parent latch L 4 0 -4
checkpoint queue latch L 6,935 910 -6,025
child cursor hash table L 15 14 -1
Consistent RBA L 66 3 -63
dml lock allocation L 7 3 -4
FIB s.o chain latch L 4 0 -4
FOB s.o list latch L 4 0 -4
hash table column usage latch L 4 15 11
lgwr LWN SCN L 66 3 -63
library cache pin allocation L 90 42 -48
list of block allocation L 7 6 -1
messages L 258 22 -236
mostly latch-free SCN L 66 3 -63
multiblock read objects L 48 0 -48
post/wait queue L 38 0 -38
redo writing L 216 13 -203
session allocation L 2 0 -2
session idle bit L 17 16 -1
session timer L 2 0 -2
sim partition latch L 20 0 -20
simulator hash latch L 5,867 203 -5,664
simulator lru latch L 206 29 -177
SQL memory manager latch L 2 0 -2
SQL memory manager workarea list latch L 134 4 -130
transaction allocation L 1 0 -1
undo global data L 693 6 -687
active txn count during cleanout S 2 0 -2
buffer is not pinned count S 244 1 -243
bytes received via SQL*Net from client S 1,123 1,181 58
calls to get snapshot scn: kcmgss S 340 3 -337
calls to kcmgas S 542 1 -541
change write time S 65 0 -65

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 41 / 72

cleanout - number of ktugct calls S 150 0 -150


cluster key scan block gets S 4 0 -4
cluster key scans S 2 0 -2
commit cleanouts S 452 0 -452
commit cleanouts successfully completed S 452 0 -452
commit txn count during cleanout S 150 0 -150
consistent changes S 2 0 -2
consistent gets - examination S 155 1 -154
CPU used by this session S 175 12 -163
CPU used when call started S 175 12 -163
CR blocks created S 2 0 -2
data blocks consistent reads - undo S 2 0 -2
records applied

db block changes S 177,204 4,421 -172,783


deferred (CURRENT) block cleanout S 2 0 -2
applications

dirty buffers inspected S 2,309 2 -2,307


enqueue releases S 213 2 -211
enqueue requests S 215 4 -211
free buffer inspected S 2,819 2 -2,817
free buffer requested S 2,339 247 -2,092
hot buffers moved to head of LRU S 139 303 164
immediate (CURRENT) block cleanout S 450 0 -450
applications

index fetch by key S 2 0 -2


index scans kdiixs1 S 11 5 -6
leaf node splits S 150 0 -150
messages sent S 63 3 -60
no work - consistent read gets S 231 6 -225
opened cursors cumulative S 18 5 -13
pinned buffers inspected S 60 0 -60
prefetched blocks S 176 0 -176
prefetched blocks aged out before use S 57 0 -57
recursive calls S 121 0 -121
redo buffer allocation retries S 2 0 -2
redo entries S 88,288 2,189 -86,099
redo log space requests S 2 0 -2
redo log space wait time S 41 0 -41
redo ordering marks S 132 0 -132
rollbacks only - consistent read gets S 2 0 -2
session pga memory S 16,336 0 -16,336
shared hash latch upgrades - no wait S 11 6 -5
switch current to new buffer S 150 0 -150
table scans (long tables) S 1 0 -1
workarea executions - optimal S 0 4 4

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 42 / 72

write clones created in foreground S 107 1 -106

buffer pool L 0 0 0
cache buffers chains L 480,644 13,914 -466,730
cache buffers lru chain L 6,850 504 -6,346
enqueue hash chains L 444 10 -434
enqueues L 126 4 -122
library cache L 282 156 -126
library cache pin L 178 78 -100
redo allocation L 88,471 2,212 -86,259
redo copy L 88,333 2,206 -86,127
row cache enqueue latch L 204 74 -130
row cache objects L 219 77 -142
shared pool L 193 152 -41

execute count S 18 5 -13


parse count (hard) S 2 2 0
parse count (total) S 18 5 -13
redo size S 22,887,828 638,912 -22,248,916
table fetch by rowid S 11 0 -11
table scan blocks gotten S 207 0 -207
table scan rows gotten S 100,000 0 -100,000

buffer is pinned count S 0 2 2


consistent gets S 563 12 -551
db block gets S 96,896 2,840 -94,056
physical reads S 651 212 -439
physical writes S 0 0 0
session logical reads S 97,459 2,852 -94,607
sorts (disk) S 0 0 0
sorts (memory) S 0 2 2
sorts (rows) S 0 6,400 6,400

elapsed time S 621 102 -519

elapsed time (in seconds) S 6.21 1.02 -5.19

List of values (Show actual 10046 STAT lines)


------------------------------------------------------------
YES
NO

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 43 / 72

Show actual 10046 STAT lines [YES]:

Actual Plan for Scenario UPDATE:PROBLEM

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=563 r=651 w=0 time=5998399 us)'
STAT #1 id=2 cnt=80000 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=200 w=0 time=480438 us)'

Actual Plan for Scenario UPDATE:ANSWER3

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=12 r=212 w=0 time=666891 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=12 r=2 w=0 time=29875 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=13743 us)'
STAT #1 id=4 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11135 us)'

List of values (Show EXPLAIN PLAN output)


------------------------------------------------------------
YES
NO

Show EXPLAIN PLAN output [YES]:

==========================================================================
UPDATE:PROBLEM

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 33333 | 99999 | 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 33333 | 99999 | 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2)

Note: cpu costing is off

==========================================================================
UPDATE:ANSWER3

---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 44 / 72

---------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 33333 | 130K| 2 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 33333 | 130K| 2 |
|* 3 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 4 | 4 | 1 |
|* 4 | INDEX RANGE SCAN | T_N3 | 8333 | 24999 | |
---------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

3 - filter("FLAGS"."FLAG"<>'B')
4 - access("T"."STATUS"=2 AND "T"."FLAG"="FLAGS"."FLAG")

Note: cpu costing is off


==========================================================================

SQL>
SQL>
SQL> @diff

List of values (First workspace)


------------------------------------------------------------
UPDATE

First workspace [UPDATE]:

List of values (First scenario)


------------------------------------------------------------
ANSWER1
ANSWER2
ANSWER3
PROBLEM

First scenario [PROBLEM]: answer2

List of values (Second workspace)


------------------------------------------------------------
UPDATE

Second workspace [UPDATE]:

List of values (Second scenario)


------------------------------------------------------------
ANSWER1

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 45 / 72

ANSWER2
ANSWER3
PROBLEM

Second scenario [ANSWER3]:

Statistic Name UPDATE UPDATE


Statistic Type (S=stat, L=Latch) ANSWER2 ANSWER3 Difference
---------------------------------------- - -------------- -------------- --------------
channel operations parent latch L 2 0 -2
checkpoint queue latch L 1,641 910 -731
child cursor hash table L 15 14 -1
Consistent RBA L 4 3 -1
hash table column usage latch L 10 15 5
lgwr LWN SCN L 4 3 -1
library cache load lock L 2 0 -2
library cache pin allocation L 58 42 -16
messages L 25 22 -3
mostly latch-free SCN L 4 3 -1
post/wait queue L 2 0 -2
redo writing L 18 13 -5
session allocation L 2 0 -2
session idle bit L 17 16 -1
session timer L 1 0 -1
sim partition latch L 1 0 -1
simulator hash latch L 258 203 -55
simulator lru latch L 62 29 -33
SQL memory manager latch L 1 0 -1
SQL memory manager workarea list latch L 71 4 -67
buffer is not pinned count S 2 1 -1
bytes received via SQL*Net from client S 1,191 1,181 -10
calls to get snapshot scn: kcmgss S 8 3 -5
calls to kcmgas S 4 1 -3
CPU used by this session S 11 12 1
CPU used when call started S 11 12 1
cursor authentications S 1 0 -1
dirty buffers inspected S 538 2 -536
free buffer inspected S 541 2 -539
free buffer requested S 537 247 -290
hot buffers moved to head of LRU S 222 303 81
index scans kdiixs1 S 9 5 -4
messages sent S 4 3 -1
no work - consistent read gets S 7 6 -1
opened cursors cumulative S 7 5 -2
parse time cpu S 2 0 -2
parse time elapsed S 13 0 -13
pinned buffers inspected S 3 0 -3

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 46 / 72

recursive calls S 5 0 -5
recursive cpu usage S 2 0 -2
shared hash latch upgrades - no wait S 10 6 -4
table scans (short tables) S 1 0 -1
workarea executions - optimal S 5 4 -1
write clones created in foreground S 4 1 -3

buffer pool L 0 0 0
cache buffers chains L 16,101 13,914 -2,187
cache buffers lru chain L 1,434 504 -930
enqueue hash chains L 12 10 -2
enqueues L 7 4 -3
library cache L 208 156 -52
library cache pin L 100 78 -22
redo allocation L 2,217 2,212 -5
redo copy L 2,209 2,206 -3
row cache enqueue latch L 120 74 -46
row cache objects L 123 77 -46
shared pool L 180 152 -28

execute count S 7 5 -2
parse count (hard) S 2 2 0
parse count (total) S 7 5 -2
redo size S 638,912 638,912 0
table fetch by rowid S 0 0 0
table scan blocks gotten S 1 0 -1
table scan rows gotten S 1 0 -1

buffer is pinned count S 2 2 0


consistent gets S 20 12 -8
db block gets S 2,840 2,840 0
physical reads S 498 212 -286
physical writes S 0 0 0
session logical reads S 2,860 2,852 -8
sorts (disk) S 0 0 0
sorts (memory) S 5 2 -3
sorts (rows) S 6,405 6,400 -5

elapsed time S 151 102 -49

elapsed time (in seconds) S 1.51 1.02 -0.49

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 47 / 72

List of values (Show actual 10046 STAT lines)


------------------------------------------------------------
YES
NO

Show actual 10046 STAT lines [YES]:

Actual Plan for Scenario UPDATE:ANSWER2

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=494 w=0 time=1203620 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=3 w=0 time=40684 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=15222 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=15205 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=15077 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=14973 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=84 us)'
STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=2 w=0 time=18340 us)'

Actual Plan for Scenario UPDATE:ANSWER3

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=12 r=212 w=0 time=666891 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=12 r=2 w=0 time=29875 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=13743 us)'
STAT #1 id=4 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11135 us)'

List of values (Show EXPLAIN PLAN output)


------------------------------------------------------------
YES
NO

Show EXPLAIN PLAN output [YES]:

==========================================================================
UPDATE:ANSWER2

----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 83333 | 488K| 26 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 83333 | 488K| 26 |
| 3 | VIEW | VW_NSO_1 | 5 | 15 | 25 |
| 4 | MINUS | | | | |
| 5 | SORT UNIQUE | | 5 | 5 | |

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 48 / 72

| 6 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 5 | 5 | 1 |


| 7 | TABLE ACCESS FULL| DUAL | 8168 | | 11 |
|* 8 | INDEX RANGE SCAN | T_N3 | 16667 | 50001 | |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

8 - access("T"."STATUS"=2 AND "T"."FLAG"="VW_NSO_1"."$nso_col_1")

Note: cpu costing is off

==========================================================================
UPDATE:ANSWER3

---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
---------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 33333 | 130K| 2 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 33333 | 130K| 2 |
|* 3 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 4 | 4 | 1 |
|* 4 | INDEX RANGE SCAN | T_N3 | 8333 | 24999 | |
---------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

3 - filter("FLAGS"."FLAG"<>'B')
4 - access("T"."STATUS"=2 AND "T"."FLAG"="FLAGS"."FLAG")

Note: cpu costing is off


==========================================================================

SQL>
SQL>
SQL> analyze table t compute statistics for columns status ;

Table analyzed.

SQL>
SQL>
SQL> get test_ans1
1 update t
2 set flag='B'
3 where status=2

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 49 / 72

4* and flag != 'B'


SQL>
SQL> @dodml
Enter .sql file name (without extension): test_ans1
Enter the workspace name: update
Enter the scenario name: answer1_hist
Display results of SQL (ON/OFF)?: off

Capturing statistics information...


=================================================================
Name of 10046 trace file: hotsos_ora_2004.trc
=================================================================

Explain Plan for Scenario update:answer1_hist

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 40000 | 117K| 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 40000 | 117K| 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2 AND "T"."FLAG"<>'B')

Note: cpu costing is off


=================================================================
Name of 10053 trace file: hotsos_ora_1088.trc
=================================================================

Actual Plan for Scenario update:answer1_hist

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=215 r=364 w=0 time=1577867 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=4 w=0 time=72003 us)'
SQL>
SQL>
SQL> @lsscstat

List of values (Workspace)


------------------------------------------------------------
UPDATE

Workspace [UPDATE]:

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 50 / 72

List of values (Scenario)


------------------------------------------------------------
ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER3
PROBLEM

Scenario [ANSWER3]: answer1_hist

Statistic Name
Statistic Type (S=stat, L=Latch) Value
---------------------------------------- - --------------
active checkpoint queue latch L 4
channel operations parent latch L 2
checkpoint queue latch L 2,101
child cursor hash table L 15
Consistent RBA L 7
dml lock allocation L 3
hash table column usage latch L 6
lgwr LWN SCN L 7
library cache pin allocation L 42
list of block allocation L 5
messages L 39
mostly latch-free SCN L 7
multiblock read objects L 2
post/wait queue L 4
redo writing L 28
session allocation L 2
session idle bit L 17
session timer L 1
sim partition latch L 1
simulator hash latch L 356
simulator lru latch L 58
SQL memory manager latch L 1
SQL memory manager workarea list latch L 67
undo global data L 11
buffer is not pinned count S 210
bytes received via SQL*Net from client S 1,142
bytes sent via SQL*Net to client S 709
calls to get snapshot scn: kcmgss S 9
calls to kcmgas S 209
change write time S 5
CPU used by this session S 23
CPU used when call started S 23

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 51 / 72

db block changes S 16,112


dirty buffers inspected S 824
enqueue releases S 4
enqueue requests S 6
free buffer inspected S 985
free buffer requested S 658
hot buffers moved to head of LRU S 65
index scans kdiixs1 S 1
messages sent S 5
no work - consistent read gets S 209
opened cursors cumulative S 6
parse time cpu S 1
parse time elapsed S 1
pinned buffers inspected S 9
prefetched blocks S 2
recursive calls S 8
redo entries S 8,011
shared hash latch upgrades - no wait S 1
SQL*Net roundtrips to/from client S 5
switch current to new buffer S 153
table scans (long tables) S 1
user calls S 8
write clones created in foreground S 56

buffer pool L 0
cache buffers chains L 64,161
cache buffers lru chain L 1,957
enqueue hash chains L 20
enqueues L 15
library cache L 150
library cache pin L 82
redo allocation L 8,043
redo copy L 8,029
row cache enqueue latch L 58
row cache objects L 62
shared pool L 130

execute count S 6
parse count (hard) S 2
parse count (total) S 6
redo size S 1,633,476
table fetch by rowid S 1
table scan blocks gotten S 207
table scan rows gotten S 100,000

buffer is pinned count S 0


consistent gets S 215
db block gets S 14,588

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 52 / 72

physical reads S 364


physical writes S 0
session logical reads S 14,803
sorts (disk) S 0
sorts (memory) S 0
sorts (rows) S 0

elapsed time (centiseconds) S 169

Actual Plan for Scenario UPDATE:ANSWER1_HIST

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=215 r=364 w=0 time=1577867 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=4 w=0 time=72003 us)'

SQL>
SQL>
SQL>
SQL> get test_ans2
1 update t
2 set flag='B'
3 where status=2
4* and flag in (select flag from flags minus select 'B' from dual )
SQL>
SQL> @dodml
Enter .sql file name (without extension): test_ans2
Enter the workspace name: update
Enter the scenario name: answer2_hist
Display results of SQL (ON/OFF)?: off

Capturing statistics information...


=================================================================
Name of 10046 trace file: hotsos_ora_812.trc
=================================================================

Explain Plan for Scenario update:answer2_hist

----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 200K| 1171K| 26 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 200K| 1171K| 26 |
| 3 | VIEW | VW_NSO_1 | 5 | 15 | 25 |
| 4 | MINUS | | | | |
| 5 | SORT UNIQUE | | 5 | 5 | |

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 53 / 72

| 6 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 5 | 5 | 1 |


| 7 | TABLE ACCESS FULL| DUAL | 8168 | | 11 |
|* 8 | INDEX RANGE SCAN | T_N3 | 40000 | 117K| |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

8 - access("T"."STATUS"=2 AND "T"."FLAG"="VW_NSO_1"."$nso_col_1")

Note: cpu costing is off


=================================================================
Name of 10053 trace file: hotsos_ora_2760.trc
=================================================================

Actual Plan for Scenario update:answer2_hist

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=411 w=0 time=1185803 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=2 w=0 time=30175 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=13335 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=13318 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=13199 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=13100 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=76 us)'
STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11444 us)'
SQL>
SQL>
SQL> @lsscstat

List of values (Workspace)


------------------------------------------------------------
UPDATE

Workspace [UPDATE]:

List of values (Scenario)


------------------------------------------------------------
ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER2_HIST
ANSWER3
PROBLEM

Scenario [ANSWER1_HIST]: answer2_hist

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 54 / 72

Statistic Name
Statistic Type (S=stat, L=Latch) Value
---------------------------------------- - --------------
active checkpoint queue latch L 2
checkpoint queue latch L 1,113
child cursor hash table L 15
Consistent RBA L 4
dml lock allocation L 3
hash table column usage latch L 10
lgwr LWN SCN L 4
library cache pin allocation L 46
list of block allocation L 6
messages L 17
mostly latch-free SCN L 4
redo writing L 14
session idle bit L 16
simulator hash latch L 206
simulator lru latch L 54
SQL memory manager workarea list latch L 4
undo global data L 7
buffer is not pinned count S 2
bytes received via SQL*Net from client S 1,191
bytes sent via SQL*Net to client S 709
calls to get snapshot scn: kcmgss S 6
calls to kcmgas S 1
consistent gets - examination S 1
CPU used by this session S 20
CPU used when call started S 20
db block changes S 4,421
dirty buffers inspected S 292
enqueue releases S 2
enqueue requests S 4
free buffer inspected S 296
free buffer requested S 446
hot buffers moved to head of LRU S 219
index scans kdiixs1 S 5
messages sent S 2
no work - consistent read gets S 7
opened cursors cumulative S 5
parse time cpu S 2
parse time elapsed S 2
pinned buffers inspected S 3
redo entries S 2,189
session pga memory max S 131,072
shared hash latch upgrades - no wait S 6
SQL*Net roundtrips to/from client S 5
table scans (short tables) S 1

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 55 / 72

user calls S 8
workarea executions - optimal S 5
write clones created in foreground S 1

buffer pool L 0
cache buffers chains L 14,833
cache buffers lru chain L 972
enqueue hash chains L 10
enqueues L 4
library cache L 173
library cache pin L 82
redo allocation L 2,215
redo copy L 2,207
row cache enqueue latch L 100
row cache objects L 104
shared pool L 152

execute count S 5
parse count (hard) S 2
parse count (total) S 5
redo size S 638,912
table fetch by rowid S 0
table scan blocks gotten S 1
table scan rows gotten S 1

buffer is pinned count S 2


consistent gets S 16
db block gets S 2,839
physical reads S 411
physical writes S 0
session logical reads S 2,855
sorts (disk) S 0
sorts (memory) S 3
sorts (rows) S 6,405

elapsed time (centiseconds) S 141

Actual Plan for Scenario UPDATE:ANSWER2_HIST

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=411 w=0 time=1185803 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=2 w=0 time=30175 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=13335 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=13318 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=13199 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=13100 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=76 us)'

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 56 / 72

STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11444 us)'

SQL>
SQL>
SQL>
SQL> get test_ans3
1 update t
2 set flag='B'
3 where status=2
4* and flag in (select flag from flags where flag != 'B')
SQL>
SQL> @dodml
Enter .sql file name (without extension): test_ans3
Enter the workspace name: update
Enter the scenario name: answer3_hist
Display results of SQL (ON/OFF)?: off

Capturing statistics information...


=================================================================
Name of 10046 trace file: hotsos_ora_3228.trc
=================================================================

Explain Plan for Scenario update:answer3_hist

---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
---------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 80000 | 312K| 2 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 80000 | 312K| 2 |
|* 3 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 4 | 4 | 1 |
|* 4 | INDEX RANGE SCAN | T_N3 | 20000 | 60000 | |
---------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

3 - filter("FLAGS"."FLAG"<>'B')
4 - access("T"."STATUS"=2 AND "T"."FLAG"="FLAGS"."FLAG")

Note: cpu costing is off


=================================================================
Name of 10053 trace file: hotsos_ora_2200.trc
=================================================================

Actual Plan for Scenario update:answer3_hist

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 57 / 72

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=12 r=174 w=0 time=565098 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=12 r=2 w=0 time=25717 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=9258 us)'
STAT #1 id=4 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11507 us)'
SQL>
SQL>
SQL> @lsscstat

List of values (Workspace)


------------------------------------------------------------
UPDATE

Workspace [UPDATE]:

List of values (Scenario)


------------------------------------------------------------
ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER2_HIST
ANSWER3
ANSWER3_HIST
PROBLEM

Scenario [ANSWER2_HIST]: answer3_hist

Statistic Name
Statistic Type (S=stat, L=Latch) Value
---------------------------------------- - --------------
active checkpoint queue latch L 2
checkpoint queue latch L 694
child cursor hash table L 15
Consistent RBA L 4
dml lock allocation L 3
hash table column usage latch L 15
lgwr LWN SCN L 4
library cache pin allocation L 40
list of block allocation L 8
messages L 19
mostly latch-free SCN L 4
redo writing L 14
session idle bit L 16
simulator hash latch L 177
simulator lru latch L 24
SQL memory manager workarea list latch L 4

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 58 / 72

transaction allocation L 2
undo global data L 17
buffer is not pinned count S 1
bytes received via SQL*Net from client S 1,181
bytes sent via SQL*Net to client S 709
calls to get snapshot scn: kcmgss S 3
change write time S 1
consistent gets - examination S 1
CPU used by this session S 14
CPU used when call started S 14
db block changes S 4,421
dirty buffers inspected S 212
enqueue releases S 2
enqueue requests S 4
free buffer inspected S 216
free buffer requested S 208
hot buffers moved to head of LRU S 441
index scans kdiixs1 S 5
messages sent S 2
no work - consistent read gets S 6
opened cursors cumulative S 5
parse time cpu S 1
parse time elapsed S 2
pinned buffers inspected S 4
redo entries S 2,189
session pga memory max S 65,536
shared hash latch upgrades - no wait S 6
SQL*Net roundtrips to/from client S 5
user calls S 8
workarea executions - optimal S 4

buffer pool L 0
cache buffers chains L 14,332
cache buffers lru chain L 636
enqueue hash chains L 16
enqueues L 4
library cache L 151
library cache pin L 76
redo allocation L 2,238
redo copy L 2,230
row cache enqueue latch L 74
row cache objects L 78
shared pool L 140

execute count S 5
parse count (hard) S 2
parse count (total) S 5
redo size S 638,912

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 59 / 72

table fetch by rowid S 0


table scan blocks gotten S 0
table scan rows gotten S 0

buffer is pinned count S 2


consistent gets S 12
db block gets S 2,839
physical reads S 174
physical writes S 0
session logical reads S 2,851
sorts (disk) S 0
sorts (memory) S 2
sorts (rows) S 6,400

elapsed time (centiseconds) S 68

Actual Plan for Scenario UPDATE:ANSWER3_HIST

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=12 r=174 w=0 time=565098 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=12 r=2 w=0 time=25717 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=9258 us)'
STAT #1 id=4 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11507 us)'

SQL>
SQL>
SQL>
SQL> @hrank update

Scenario ranking for workspace update by elapsed time

Elapsed Time (secs) Scenario Name


--------------------- --------------------------------------------------------------------------------
0.680000 ANSWER3_HIST
1.020000 ANSWER3
1.410000 ANSWER2_HIST
1.510000 ANSWER2
1.690000 ANSWER1_HIST
2.340000 ANSWER1
6.210000 PROBLEM

SQL>
SQL>
SQL> @diff

List of values (First workspace)


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

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 60 / 72

UPDATE

First workspace [UPDATE]:

List of values (First scenario)


------------------------------------------------------------
ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER2_HIST
ANSWER3
ANSWER3_HIST
PROBLEM

First scenario [ANSWER2]: answer1

List of values (Second workspace)


------------------------------------------------------------
UPDATE

Second workspace [UPDATE]:

List of values (Second scenario)


------------------------------------------------------------
ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER2_HIST
ANSWER3
ANSWER3_HIST
PROBLEM

Second scenario [ANSWER3]: answer1_hist

Statistic Name UPDATE UPDATE


Statistic Type (S=stat, L=Latch) ANSWER1 ANSWER1_HIST Difference
---------------------------------------- - -------------- -------------- --------------
checkpoint queue latch L 2,357 2,101 -256
Consistent RBA L 5 7 2
lgwr LWN SCN L 5 7 2
list of block allocation L 6 5 -1
messages L 31 39 8
mostly latch-free SCN L 5 7 2
multiblock read objects L 48 2 -46

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 61 / 72

redo writing L 21 28 7
session timer L 0 1 1
sim partition latch L 2 1 -1
simulator hash latch L 464 356 -108
simulator lru latch L 91 58 -33
undo global data L 10 11 1
calls to kcmgas S 178 209 31
change write time S 0 5 5
CPU used by this session S 33 23 -10
CPU used when call started S 33 23 -10
db block changes S 16,111 16,112 1
dirty buffers inspected S 835 824 -11
free buffer inspected S 898 985 87
free buffer requested S 981 658 -323
hot buffers moved to head of LRU S 365 65 -300
messages sent S 6 5 -1
parse time cpu S 0 1 1
parse time elapsed S 0 1 1
pinned buffers inspected S 36 9 -27
prefetched blocks S 181 2 -179
prefetched blocks aged out before use S 25 0 -25
session pga memory S 189,544 0 -189,544
switch current to new buffer S 166 153 -13
write clones created in foreground S 12 56 44

buffer pool L 0 0 0
cache buffers chains L 65,004 64,161 -843
cache buffers lru chain L 2,507 1,957 -550
enqueue hash chains L 16 20 4
enqueues L 11 15 4
library cache L 150 150 0
library cache pin L 82 82 0
redo allocation L 8,038 8,043 5
redo copy L 8,028 8,029 1
row cache enqueue latch L 58 58 0
row cache objects L 61 62 1
shared pool L 136 130 -6

execute count S 6 6 0
parse count (hard) S 2 2 0
parse count (total) S 6 6 0
redo size S 1,633,416 1,633,476 60
table fetch by rowid S 1 1 0
table scan blocks gotten S 207 207 0
table scan rows gotten S 100,000 100,000 0

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 62 / 72

buffer is pinned count S 0 0 0


consistent gets S 215 215 0
db block gets S 14,585 14,588 3
physical reads S 717 364 -353
physical writes S 0 0 0
session logical reads S 14,800 14,803 3
sorts (disk) S 0 0 0
sorts (memory) S 0 0 0
sorts (rows) S 0 0 0

elapsed time S 234 169 -65

elapsed time (in seconds) S 2.34 1.69 -0.65

List of values (Show actual 10046 STAT lines)


------------------------------------------------------------
YES
NO

Show actual 10046 STAT lines [YES]:

Actual Plan for Scenario UPDATE:ANSWER1

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=215 r=717 w=0 time=2217354 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=205 w=0 time=277281 us)'

Actual Plan for Scenario UPDATE:ANSWER1_HIST

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=215 r=364 w=0 time=1577867 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=29237 op='TABLE ACCESS FULL T (cr=211 r=4 w=0 time=72003 us)'

List of values (Show EXPLAIN PLAN output)


------------------------------------------------------------
YES
NO

Show EXPLAIN PLAN output [YES]:

==========================================================================
UPDATE:ANSWER1

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 63 / 72

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 16667 | 50001 | 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 16667 | 50001 | 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2 AND "T"."FLAG"<>'B')

Note: cpu costing is off

==========================================================================
UPDATE:ANSWER1_HIST

--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 40000 | 117K| 22 |
| 1 | UPDATE | T | | | |
|* 2 | TABLE ACCESS FULL | T | 40000 | 117K| 22 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):


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

2 - filter("T"."STATUS"=2 AND "T"."FLAG"<>'B')

Note: cpu costing is off


==========================================================================

SQL>
SQL>
SQL> @diff

List of values (First workspace)


------------------------------------------------------------
UPDATE

First workspace [UPDATE]:

List of values (First scenario)


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

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 64 / 72

ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER2_HIST
ANSWER3
ANSWER3_HIST
PROBLEM

First scenario [ANSWER1]: answer2

List of values (Second workspace)


------------------------------------------------------------
UPDATE

Second workspace [UPDATE]:

List of values (Second scenario)


------------------------------------------------------------
ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER2_HIST
ANSWER3
ANSWER3_HIST
PROBLEM

Second scenario [ANSWER1_HIST]: answer2_hist

Statistic Name UPDATE UPDATE


Statistic Type (S=stat, L=Latch) ANSWER2 ANSWER2_HIST Difference
---------------------------------------- - -------------- -------------- --------------
active checkpoint queue latch L 4 2 -2
channel operations parent latch L 2 0 -2
checkpoint queue latch L 1,641 1,113 -528
library cache load lock L 2 0 -2
library cache pin allocation L 58 46 -12
messages L 25 17 -8
post/wait queue L 2 0 -2
redo writing L 18 14 -4
session allocation L 2 0 -2
session idle bit L 17 16 -1
session timer L 1 0 -1
sim partition latch L 1 0 -1
simulator hash latch L 258 206 -52
simulator lru latch L 62 54 -8

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 65 / 72

SQL memory manager latch L 1 0 -1


SQL memory manager workarea list latch L 71 4 -67
undo global data L 6 7 1
calls to get snapshot scn: kcmgss S 8 6 -2
calls to kcmgas S 4 1 -3
CPU used by this session S 11 20 9
CPU used when call started S 11 20 9
cursor authentications S 1 0 -1
dirty buffers inspected S 538 292 -246
free buffer inspected S 541 296 -245
free buffer requested S 537 446 -91
hot buffers moved to head of LRU S 222 219 -3
index scans kdiixs1 S 9 5 -4
messages sent S 4 2 -2
opened cursors cumulative S 7 5 -2
parse time elapsed S 13 2 -11
recursive calls S 5 0 -5
recursive cpu usage S 2 0 -2
session pga memory max S 0 131,072 131,072
shared hash latch upgrades - no wait S 10 6 -4
write clones created in foreground S 4 1 -3

buffer pool L 0 0 0
cache buffers chains L 16,101 14,833 -1,268
cache buffers lru chain L 1,434 972 -462
enqueue hash chains L 12 10 -2
enqueues L 7 4 -3
library cache L 208 173 -35
library cache pin L 100 82 -18
redo allocation L 2,217 2,215 -2
redo copy L 2,209 2,207 -2
row cache enqueue latch L 120 100 -20
row cache objects L 123 104 -19
shared pool L 180 152 -28

execute count S 7 5 -2
parse count (hard) S 2 2 0
parse count (total) S 7 5 -2
redo size S 638,912 638,912 0
table fetch by rowid S 0 0 0
table scan blocks gotten S 1 1 0
table scan rows gotten S 1 1 0

buffer is pinned count S 2 2 0


consistent gets S 20 16 -4

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 66 / 72

db block gets S 2,840 2,839 -1


physical reads S 498 411 -87
physical writes S 0 0 0
session logical reads S 2,860 2,855 -5
sorts (disk) S 0 0 0
sorts (memory) S 5 3 -2
sorts (rows) S 6,405 6,405 0

elapsed time S 151 141 -10

elapsed time (in seconds) S 1.51 1.41 -0.10

List of values (Show actual 10046 STAT lines)


------------------------------------------------------------
YES
NO

Show actual 10046 STAT lines [YES]:

Actual Plan for Scenario UPDATE:ANSWER2

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=494 w=0 time=1203620 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=3 w=0 time=40684 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=15222 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=15205 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=15077 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=14973 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=84 us)'
STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=2 w=0 time=18340 us)'

Actual Plan for Scenario UPDATE:ANSWER2_HIST

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=15 r=411 w=0 time=1185803 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=15 r=2 w=0 time=30175 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=0 op='VIEW (cr=4 r=1 w=0 time=13335 us)'
STAT #1 id=4 cnt=4 pid=3 pos=1 obj=0 op='MINUS (cr=4 r=1 w=0 time=13318 us)'
STAT #1 id=5 cnt=5 pid=4 pos=1 obj=0 op='SORT UNIQUE (cr=1 r=1 w=0 time=13199 us)'
STAT #1 id=6 cnt=5 pid=5 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=13100 us)'
STAT #1 id=7 cnt=1 pid=4 pos=2 obj=222 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=76 us)'
STAT #1 id=8 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11444 us)'

List of values (Show EXPLAIN PLAN output)

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 67 / 72

------------------------------------------------------------
YES
NO

Show EXPLAIN PLAN output [YES]:

==========================================================================
UPDATE:ANSWER2

----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 83333 | 488K| 26 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 83333 | 488K| 26 |
| 3 | VIEW | VW_NSO_1 | 5 | 15 | 25 |
| 4 | MINUS | | | | |
| 5 | SORT UNIQUE | | 5 | 5 | |
| 6 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 5 | 5 | 1 |
| 7 | TABLE ACCESS FULL| DUAL | 8168 | | 11 |
|* 8 | INDEX RANGE SCAN | T_N3 | 16667 | 50001 | |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

8 - access("T"."STATUS"=2 AND "T"."FLAG"="VW_NSO_1"."$nso_col_1")

Note: cpu costing is off

==========================================================================
UPDATE:ANSWER2_HIST

----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
----------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 200K| 1171K| 26 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 200K| 1171K| 26 |
| 3 | VIEW | VW_NSO_1 | 5 | 15 | 25 |
| 4 | MINUS | | | | |
| 5 | SORT UNIQUE | | 5 | 5 | |
| 6 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 5 | 5 | 1 |
| 7 | TABLE ACCESS FULL| DUAL | 8168 | | 11 |
|* 8 | INDEX RANGE SCAN | T_N3 | 40000 | 117K| |
----------------------------------------------------------------------------

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 68 / 72

Predicate Information (identified by operation id):


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

8 - access("T"."STATUS"=2 AND "T"."FLAG"="VW_NSO_1"."$nso_col_1")

Note: cpu costing is off


==========================================================================

SQL>
SQL> @diff

List of values (First workspace)


------------------------------------------------------------
UPDATE

First workspace [UPDATE]:

List of values (First scenario)


------------------------------------------------------------
ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER2_HIST
ANSWER3
ANSWER3_HIST
PROBLEM

First scenario [ANSWER2]: answer3

List of values (Second workspace)


------------------------------------------------------------
UPDATE

Second workspace [UPDATE]:

List of values (Second scenario)


------------------------------------------------------------
ANSWER1
ANSWER1_HIST
ANSWER2
ANSWER2_HIST
ANSWER3
ANSWER3_HIST
PROBLEM

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 69 / 72

Second scenario [ANSWER2_HIST]: answer3_hist

Statistic Name UPDATE UPDATE


Statistic Type (S=stat, L=Latch) ANSWER3 ANSWER3_HIST Difference
---------------------------------------- - -------------- -------------- --------------
active checkpoint queue latch L 4 2 -2
checkpoint queue latch L 910 694 -216
child cursor hash table L 14 15 1
Consistent RBA L 3 4 1
lgwr LWN SCN L 3 4 1
library cache pin allocation L 42 40 -2
list of block allocation L 6 8 2
messages L 22 19 -3
mostly latch-free SCN L 3 4 1
redo writing L 13 14 1
simulator hash latch L 203 177 -26
simulator lru latch L 29 24 -5
transaction allocation L 0 2 2
undo global data L 6 17 11
calls to kcmgas S 1 0 -1
change write time S 0 1 1
CPU used by this session S 12 14 2
CPU used when call started S 12 14 2
dirty buffers inspected S 2 212 210
free buffer inspected S 2 216 214
free buffer requested S 247 208 -39
hot buffers moved to head of LRU S 303 441 138
messages sent S 3 2 -1
parse time cpu S 0 1 1
parse time elapsed S 0 2 2
pinned buffers inspected S 0 4 4
session pga memory max S 0 65,536 65,536
write clones created in foreground S 1 0 -1

buffer pool L 0 0 0
cache buffers chains L 13,914 14,332 418
cache buffers lru chain L 504 636 132
enqueue hash chains L 10 16 6
enqueues L 4 4 0
library cache L 156 151 -5
library cache pin L 78 76 -2
redo allocation L 2,212 2,238 26
redo copy L 2,206 2,230 24
row cache enqueue latch L 74 74 0
row cache objects L 77 78 1
shared pool L 152 140 -12

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 70 / 72

execute count S 5 5 0
parse count (hard) S 2 2 0
parse count (total) S 5 5 0
redo size S 638,912 638,912 0
table fetch by rowid S 0 0 0
table scan blocks gotten S 0 0 0
table scan rows gotten S 0 0 0

buffer is pinned count S 2 2 0


consistent gets S 12 12 0
db block gets S 2,840 2,839 -1
physical reads S 212 174 -38
physical writes S 0 0 0
session logical reads S 2,852 2,851 -1
sorts (disk) S 0 0 0
sorts (memory) S 2 2 0
sorts (rows) S 6,400 6,400 0

elapsed time S 102 68 -34

elapsed time (in seconds) S 1.02 0.68 -0.34

List of values (Show actual 10046 STAT lines)


------------------------------------------------------------
YES
NO

Show actual 10046 STAT lines [YES]:

Actual Plan for Scenario UPDATE:ANSWER3

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=12 r=212 w=0 time=666891 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=12 r=2 w=0 time=29875 us)'
STAT #1 id=3 cnt=4 pid=2 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=13743 us)'
STAT #1 id=4 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11135 us)'

Actual Plan for Scenario UPDATE:ANSWER3_HIST

STAT #1 id=1 cnt=0 pid=0 pos=1 obj=0 op='UPDATE (cr=12 r=174 w=0 time=565098 us)'
STAT #1 id=2 cnt=1600 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=12 r=2 w=0 time=25717 us)'

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 71 / 72

STAT #1 id=3 cnt=4 pid=2 pos=1 obj=29236 op='INDEX FULL SCAN SYS_IOT_TOP_29235 (cr=1 r=1 w=0 time=9258 us)'
STAT #1 id=4 cnt=1600 pid=2 pos=2 obj=29241 op='INDEX RANGE SCAN T_N3 (cr=11 r=1 w=0 time=11507 us)'

List of values (Show EXPLAIN PLAN output)


------------------------------------------------------------
YES
NO

Show EXPLAIN PLAN output [YES]:

==========================================================================
UPDATE:ANSWER3

---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
---------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 33333 | 130K| 2 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 33333 | 130K| 2 |
|* 3 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 4 | 4 | 1 |
|* 4 | INDEX RANGE SCAN | T_N3 | 8333 | 24999 | |
---------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

3 - filter("FLAGS"."FLAG"<>'B')
4 - access("T"."STATUS"=2 AND "T"."FLAG"="FLAGS"."FLAG")

Note: cpu costing is off

==========================================================================
UPDATE:ANSWER3_HIST

---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
---------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 80000 | 312K| 2 |
| 1 | UPDATE | T | | | |
| 2 | NESTED LOOPS | | 80000 | 312K| 2 |
|* 3 | INDEX FULL SCAN | SYS_IOT_TOP_29235 | 4 | 4 | 1 |
|* 4 | INDEX RANGE SCAN | T_N3 | 20000 | 60000 | |
---------------------------------------------------------------------------

Predicate Information (identified by operation id):


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

March 04, 2005 case study.txt


Hotsos Symposium 2005 - The Basics of an Effective Test Environment 72 / 72

3 - filter("FLAGS"."FLAG"<>'B')
4 - access("T"."STATUS"=2 AND "T"."FLAG"="FLAGS"."FLAG")

Note: cpu costing is off


==========================================================================

SQL>

March 04, 2005 case study.txt

You might also like