oracle - 收集分区表的统计信息
问题描述
Ultimately i need to know if this will be enough. In oracle, there is a setting on a table to incrementally gather statistics, rather than a full table. Basically, it will only gather stats on partitions where the data has changed. We need to make sure all partitioned tables have INCREMENTAL set to TRUE.
On Partitioning Tables just setting Incremental to true is enough or do we have to also set Publish command to true as well? If so how can i add it?
BEGIN
DBMS_STATS.SET_TABLE_PREFS ('ANT', 'S_WAREHOUSE_PRODUCT_FACT', 'INCREMENTAL', 'TRUE');
END
P 请让我知道是否需要更改或添加到代码中。这对我正在做的事情有必要吗?
1) The PUBLISH value for the partitioned table is true.(Default is TRUE)
2)The user specifies AUTO_SAMPLE_SIZE for ESTIMATE_PERCENT and AUTO for GRANULARITY when gathering statistics on the table.(Default is ESTIMATE_PERCENT=>AUTO_SAMPLE_SIZE and GRANULARITY=>AUTO)
How can i verify if tables already has publish set to true?
Can i leave default value as it is? Default is
ESTIMATE_PERCENT=>AUTO_SAMPLE_SIZE and GRANULARITY=>AUTO
解决方案
要么使用
BEGIN
DBMS_STATS.SET_TABLE_PREFS ('DW_FEI', 'INVOICE_HEADER_FACT', 'INCREMENTAL', 'TRUE');
END;
/
或者
EXEC DBMS_STATS.SET_TABLE_PREFS ('DW_FEI', 'INVOICE_HEADER_FACT', 'INCREMENTAL', 'TRUE');
但不能同时两者。
推荐阅读
- hashtable - 散列,不能插入到散列表
- c# - 如何注入托管工作者服务?
- dolphindb - 在 DolphinDB 数据库中使矩阵的所有负元素为 0 的最简单方法是什么?
- tcl - TCL脚本遍历目录中的所有文件夹并执行功能
- automation - WebdriverIO Browser.click 语句给出的不是函数错误
- testing - 可以创建将项目中的测试子集化的 gradle 任务吗?
- javascript - Webpack - 如何通过 image-webpack-loader 将 jpg/png 转换为 webp
- xcode - 为什么我不能下载 11.2.1
- sql-server - 尝试在 win 7 上安装 SQL Server 2012。它是 64 位机器。我收到以下错误
- bash - 如何按第一个字段从最低数字到最高排序,而不是按第二个字段从最高到最低数字排序?