Although it's not well-known yet, many statistics of child(recursive)
statements are included in their parent's statistics. If you
query dictionary views directly, you may fall in this trap.
This may distort your measurements and decisions.
Here is a sample for PL/SQL statement which inludes an INSERT
statement:
Parent PL/SQL statement: BEGIN pdoug; END;
Child(recursive) statement: INSERT INTO DOUG VALUES ( :b1,:b2
)
select
SQL_TEXT,DISK_READS,BUFFER_GETS,ROWS_PROCESSED from v$sql
where upper(SQL_TEXT) like '%DOUG%';
SQL_TEXT |
DISK_READS
|
BUFFER_GET
|
----------------------------------- |
-----------
|
-----------
|
INSERT
INTO DOUG VALUES ( :b1,:b2 ) |
3533
|
138083
|
BEGIN
pdoug; END; |
3533
|
138083
|
As seen above, the statistics are reported twice for both statements.
This distortion can be occur on any statements if statements
call any other statements such as triggers, functions, internal
Oracle statements, etc.
Any scripts, any tools which get values directly from Oracle
dictionary may fall in this important, but not well-known measurement
problem.
itrprof SQL Analyzer can report both cumulative and exclusive
statistics without distorting any statistics.
|