COMPUTE STATISTICS
GATHER DATABASE STATS Procedure
EXEC dbms_stats
+ GATHER_DICTIONARY_STATS Procedure
EXEC doms_stats. gather dictionary stats:
+ GATHER_SCHEMA STATS Procedure
stats(ownnane=> st?)
EXEC dbms_stats. gather _schent
EXEC db
s_stats.gather_systen_stats(‘Start’);
+ GATHER TABLE STATS Procedure
‘SELECT * FROM sys.aux stats
SQL TUNING
EXEC dbns_stats. gether_table_stats (ownnat
‘tabname=> ‘SALES?, cascade
+ GATHER INDEX STATS ProcedureExecution Plan & Statistics
@ Howcanwe see the Optimizer Statistics?
+ DBATABLES
DBA_TAB_STATISTICS
DBA_TAB_COL STATISTICS
DBAINDEXES
DBA_CLUSTERS
DBA_TAB_PARTITIONS / ?
DBA_IND_PARTITIONS,
DBA_PART_COL STATISTICS a
Oi
SQLTUNING ce a eeeExecution Plan & Statistics
* To analyze an execution plan: : {
+ Explain Plan Kip <
+ Autotrace
+ V$SQLPLAN
* EXPLAIN PLAN
EXPLAIN PLAN FOR Attributes of Indexes E27002 David Motsinger_ £27002
41298 Tim Sampair £03033
* Key Compression 43128 Kim Arlich £10001
+ Reverse Key 63535, Timothy Grove __ 16398
* Ascending - Descending Ordered IndexesTable & Index Access Paths1e@ee1eeeee0e0000101000e000010
@1000111111000100101111111101
@0110000000111010000000000000
wrasse | woman 19 @ 96 0000000000000000000000000
eRe] SS LeTable & Index Access Paths
eae
> Table Access Paths
v Table Access Full
v Table Access by ROWID
¥ Sample Table Scan
> Index Access Paths
Index Unique Scan
Index Range Scan
Index Full Scan
Index Fast Full Scan
Index Skip Scan
Index Join Sean ry
Index Organized Tables.
Bitmap Access Paths| * r
So Beret)
Sn ~~ Bea acaTable & Index Access Paths
ee)
> Table Access by ROWID occurs when : Tt
V ROWID is used in the where clause directly ts
v By an Index Scan operation se
SQLTUNING [oR ee BeTable & Index Access Paths
reuseTable & Index Access Paths
IESa se
> tthe data we quetied is bounded from one or bethsldes,the optimizer canuse B
> theo ‘one ormore le ina. it wil fades
a ONIN) See ere eeTable & Index Access Paths
DES
> All the rows of the tables are indexed by their indexes
>» When the optimizer uses the index full scan?
> Query has order by clause only with the indexed columns.
> Query has group by clause only with the indexed columns. &
> Query requires a sort-merge join. a fl
SQLTUNING [oR ee Be