[bbk2344] 第49集 - Chapter 12-Optimizing Sore Perations(04)
2013-05-07 17:52
1086 查看
Generating Histograms
Histogram statistics are generated by:SQL>EXECUTE dbms_stats.gather_table_stats('HR','EMPLOYEES',METHOD_OPT => 'FOR COLUMNS SIZE 10 salary') ;
Histograms are specified using the METHOD_OPT argument of the DBMS_STATS gathering procedure.Oracle recommends setting the MEHTHOD_OPT to FOR ALL COLUMNS SIZE AUTO.Wtih this setting,Oracle automatically determines which columns require histograms and the number of buckets(size) of each histogram.You can also manually specify which columns should have histograms and the size of each histogram.
生成直方图
SQL> SELECT endpoint_number,endpoint_value FROM dba_histograms WHERE owner='HR' and table_name = 'T' AND column_name = 'ID'; ENDPOINT_NUMBER ENDPOINT_VALUE --------------- -------------- 0 1 1 10 2 20 3 30 4 40 5 50 6 60 7 70 8 80 9 90 10 100 11 rows selected.
Gather Statistics Estimates
dbms_stats.auto_samp[le_size:New estimate_percent value
MEHTOD_OPT options:
-REPEAT:New histogram with same number of buckets
-AUTO:Net histogram based on data distribution and application workload
-SKEWONLY:New histogram based on data distribution
SQL>EXECUTE dbms_status.gather_schema_stats(ownname => 'OE',estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE,method_opt => 'for all columns size AUTO');
Auto Statistics Collecting
For the dbms_status.gather_schema_stats procedure set OPTIONS to:Gather stale
Gather Empty
Gather Auto
SQL>EXEC dbms_stats.gather_schema_stats(OWNNAME => 'OE',OPTIONS => 'GATHER AUTO');
如何让一张表处于被监控状态?
alter table hr.t monitoring;
Statistics分为四大类
TableIndex
Column
System
Optimizer Cost Model
Three columns in plan_table are:-cpu_cost:Estimated CPU cost of the operation
-io_cost:Estimated I/O cost of the operation
-temp_space:Estimated temporary space(in bytes)
Include CPU usage
Accounts for the effect of caching
Accounts for index prefetching
相关文章推荐
- [bbk2343] 第48集 - Chapter 12-Optimizing Sore Perations(03)
- [bbk2345] 第50集 - Chapter 12-Optimizing Sore Perations(05)
- [bbk2194] 第35集 - Chapter 09-Optimizing Sore Perations(04)
- [bbk2195] 第36集 - Chapter 09-Optimizing Sore Perations(05)
- [bbk2190] 第31集 - Chapter 09-Optimizing Sore Perations(00)
- [bbk2191] 第32集 - Chapter 09-Optimizing Sore Perations(01)
- [bbk2192] 第33集 - Chapter 09-Optimizing Sore Perations(02)
- [bbk2340] 第45集 - Chapter 09-Optimizing Sore Perations(00)
- [bbk2193] 第34集 - Chapter 09-Optimizing Sore Perations(03)
- [bbk2341] 第46集 - Chapter 09-Optimizing Sore Perations(01)
- [bbk2342] 第47集 - Chapter 09-Optimizing Sore Perations(02)
- android应用开发揭秘examples_04-12笔记(Button的使用)
- 《C++捷径教程》读书笔记--Chapter 12--类的深入学习(完结)
- Programming Windows with MFC - Chapter 12 Toolbars
- 《C++捷径教程》读书笔记--Chapter 18--C++的I/O系统--12-15
- 13/05/12 HDU chapter one 简单题
- MPEG4(ISO/IEC 14496-12)学习笔记chapter-7
- 【APUE】Chapter12
- [bbk3100]第7集 - Chapter 04 - 介绍RAC中CVU工具的使用
- Data Structures (Weiss) Chapter 12: Splay Tree 伸展树