11G新特性 -- 分区表和增量统计信息
2015-08-13 13:19
369 查看
对于分区表,优化器会在全局级别为整个表维护一份统计信息,也会在分区级别为分区表维护一份统计信息。 对于大多数分区,dml一般都是在最近的分区上执行。在11g中,数据库支持只对那些发生一定数据变化的分区收集统计信息(默认的threshold是分区的10%的行)
11g之前,数据库为了获得global统计信息,必须扫描整个表。而在11g中,数据库可以增量维护global统计信息,通过仅扫描那些有一定比例数据发生变化的分区,其他分区仍然使用老的统计信息。
分区表的增量统计信息不会增量维护直方图。
使用dbms_stat包指定分区表的分析粒度(auto、global、global and partition、all、partition、subpartition)。 如果将粒度设置为global并且将表标记为incremental的,数据库在增量的基础上收集全局统计信息。数据库也会对发生改变的分区进行自动收集统计信息。
11g之前,数据库为了获得global统计信息,必须扫描整个表。而在11g中,数据库可以增量维护global统计信息,通过仅扫描那些有一定比例数据发生变化的分区,其他分区仍然使用老的统计信息。
分区表的增量统计信息不会增量维护直方图。
使用dbms_stat包指定分区表的分析粒度(auto、global、global and partition、all、partition、subpartition)。 如果将粒度设置为global并且将表标记为incremental的,数据库在增量的基础上收集全局统计信息。数据库也会对发生改变的分区进行自动收集统计信息。
Oracle will update the global table statistics by scanning only the partitions that have been changed instead of the entire table if the following conditions hold: •INCREMENTAL value for the partitioned table is set to TRUE; •PUBLISH value for the partitioned table is set to TRUE; •User specifies AUTO_SAMPLE_SIZE for ESTIMATE_PERCENT and AUTO for GRANULARITY when gathering statistics on the table
begin dbms_stats.set_table_prefs( 'SCOTT','DEPT','INCREMENTAL','TRUE'); end; / 现在,您应该专门收集此表中粒度为 AUTO的分区 DEPT_01 上的统计信息。 begin dbms_stats.gather_table_stats ( ownname => 'SCOTT', tabname => 'DEPT', partname => 'DEPT_01', granularity => 'AUTO' ); end;
相关文章推荐
- 网络编程复习_ Exp2
- Redmine的创建任务的性能问题
- 黑马程序员——java复习总结——多线程
- 正则表达式全部符号解释
- 中国获得2022年冬奥会举办权【经济学人】
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 中国获得2022年冬奥会举办权【经济学人】
- Window_Open详解
- 工厂方法模式
- 数据恢复陶工SS6K21CB东芝USB3.016G优盘不识别无盘符主控损坏Flahs颗粒恢复数据
- Git常用操作 - 分支管理
- HierarchyViewer源代码理解(三)
- BZOJ 1045 [HAOI2008] 糖果传递
- PAT 1062. Talent and Virtue (25)
- 【百度网盘】老罗android开发视频教程[压缩后3.63G]
- java中TCP传输协议
- 微信企业号回调模式配置讲解 Java Servlet+Struts2版本 echostr校验失败解决
- undefined function mysql_connect()解决方法
- 服务器配置apache2.4+php5.6+mysql
- SpringMVC maven mybatis