Pending Statistics
Starting with the 11g Release 1 (11.1), when gathering statistics, you have the option to automatically publish the statistics at the end of the gather operation (default behavior), or to have the new statistics saved as pending. Saving the new statistics as pending allows you to validate the new statistics and publish them only if they are satisfactory.
You can check whether or not the statistics will be automatically published as soon as they are gathered by checking the value of the PUBLISH
attribute using the DBMS_STATS
package:
Select dbms_stats.get_prefs('PUBLISH') publish from dual;
This query will return either TRUE
or FALSE
. TRUE
indicates that the statistics will be published as and when they are gathered, while FALSE
indicates that the statistics will be kept pending.
Note:
Published statistics are stored in data dictionary views, such as USER_TAB_STATISTICS
and USER_IND_STATISTICS
. Pending statistics are stored in views such as USER_TAB_PENDING_STATS
and USER_IND_PENDING_STATS
.
You can change the PUBLISH
setting at either the schema or the table level. For example, to change the PUBLISH
setting for the customers
table in the SH
schema, execute the statement:
Exec dbms_stats.set_table_prefs('SH', 'CUSTOMERS', 'PUBLISH', 'false');
Subsequently, when you gather statistics on the customers
table, the statistics will not be automatically published when the gather job completes. Instead, the newly gathered statistics will be stored in the USER_TAB_PENDING_STATS
table.
By default, the optimizer uses the published statistics stored in the data dictionary views. If you want the optimizer to use the newly collected pending statistics, set the initialization parameter OPTIMIZER_USE_PENDING_STATISTICS
to TRUE
(the default value is FALSE
), and run a workload against the table or schema:
alter session set optimizer_use_pending_statistics = TRUE;
The optimizer will use the pending statistics instead of the published statistics when compiling SQL statements.If the pending statistics are valid, they can be made public by executing the following statement:
Exec dbms_stats.publish_pending_stats(null, null);
You can also publish the pending statistics for a specific database object. For example, by using the following statement:
Exec dbms_stats.publish_pending_stats('SH','CUSTOMERS');
If you do not want to publish the pending statistics, delete them by executing the following statement:
Exec dbms_stats.delete_pending_stats('SH','CUSTOMERS');
You can export pending statistics using dbms_stats.export_pending_stats
function. Exporting pending statistics to a test system enables you to run a full workload against the new statistics.
http://docs.oracle.com/cd/B28359_01/server.111/b28274/stats.htm#BEIEGBGI
Pending Statistics的更多相关文章
- 11G新特性 -- Statistics Preferences
Statistics Preferences新特性可以实现对指定对象进行信息收集. 可以在table.schema.database.global级别设置statistics preference. ...
- 1Z0-050
QUESTION 13 View the Exhibit.Examine the following command that is executed for the TRANSPORT table ...
- oracle_hc.sql
select event,count(1) from gv$session group by event order by 2;exec dbms_workload_repository.create ...
- Oracle 所有字典
select * from DBA_CONS_COLUMNS ; ---Information about accessible columns in constraint definitions s ...
- SPA 介绍
SQL 性能分析器(SPA)工具概览 作为 Oracle Real Application Testing 选件/特性,这篇文章将提供一个关于 SQL 性能分析器(SPA)工具的简要概览.这是此系列的 ...
- 我的oracle 健康检查报告
最近一直想用sql来生成oracle的健康检查报告,这样看起来一目了然,经过网上搜资料加自己整理终于算是成型了,部分结果如下图所示, 具体参考附件,恳请广大网友看看是否还有需要添加的地方. DB_he ...
- oracle之三存储库及顾问框架
AWR存储库及顾问框架(PPT-I-349-360) 14.1 Oracle数据库采样ASH和AWR. 1) ASH(Active Session History) ASH收集的是活动会话的样本数据, ...
- [Hive - LanguageManual] Statistics in Hive
Statistics in Hive Statistics in Hive Motivation Scope Table and Partition Statistics Column Statist ...
- ABBA BABA statistics
The ABBA BABA statistics are used to detect and quantify an excess of shared derived alleles, which ...
随机推荐
- 安装nodejs+ionic+cordova环境心得
1.安装node-v0.10.38-x64.msi版本(从nodejs中下载最稳定版本,最后安装ionic安不上,然后又安装node-v0.10.38-x64.msi,再安装ionicok了.不知道是 ...
- CL.exe的 /D 选项, Preprocessor Macro预处理器宏定义
在看"Inside COM"第10章的代码. MAKEFILE里面有几个标记我没看懂. 去网上搜也搜不到. /D_OUTPROC_SERVER_ /DWIN32 /DREGISTE ...
- UILabel属性
1.text:设置标签显示文本. 2.attributedText:设置标签属性文本. Ios代码 NSString *text = @"first"; NSMutableAttr ...
- Java Servlet(二):servlet配置及生命周期相关(jdk7+tomcat7+eclipse)
该篇文章记录了Servlet配置相关用法及Servlet在Servlet容器中生命周期方法. Tomcat是一个Servlet容器: 1.Servlet容器管理了Servlet的整个生命周期,并调用s ...
- Silverlight TabItem选中,未选中样式设置
<Application.Resources> <LinearGradientBrush x:Key="TabItemBackground" EndPoint=& ...
- Highcharts选项配置详细说明文档(zz)
http://www.helloweba.com/view-blog-156.html Highcharts提供大量的选项配置参数,您可以轻松定制符合用户要求的图表,目前官网只提供英文版的开发配置说明 ...
- PostgreSQL Replication之第十一章 使用Skytools(1)
向您介绍了 Slony 之后,我们将介绍另外一种流行的复制工作.Skytools 是一个最初有 Skype 开发的软件包,它有多种用途.Skytools 不只是一个单一的程序,而且是一个工具与服务的集 ...
- 点的双联通+二分图的判定(poj2942)
Knights of the Round Table Time Limit: 7000MS Memory Limit: 65536K Total Submissions: 10804 Acce ...
- list和set的区别
list和set的区别 相同点:list,set都是继承自collection接口 不同点: a.list-->元素有放入顺序,元素可重复 set-->元素无放入顺序,元素不可重复 b. ...
- HDU 4069 Squiggly Sudoku(DLX)(The 36th ACM/ICPC Asia Regional Fuzhou Site —— Online Contest)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4069 Problem Description Today we play a squiggly sud ...