在什么情况下,oracle会认为已经统计的信息失效

是这样的,想请讲解下,在什么情况下,oracle会认为已经统计的信息失效
最新回答
沉鱼落雁

2026-05-29 14:20:44

比如说一个表在昨天分析的,根据分析后结果看到当时的记录条数是1000条,而从DBA_TAB_MODIFICATIONS表种看到的inserts为10,updates为10,deletes为10,inserts+updates+deletes=30

30/1000*100%=3%,所以不用对这个表分析
Note that both gather stale and gather auto require monitoring. If you issue the “alter table xxx monitoring” command, Oracle tracks changed tables with the dba_tab_modifications view. Below we see that the exact number of inserts, updates and deletes are tracked since the last analysis of statistics.

SQL> desc dba_tab_modifications;

Name Type
--------------------------------
TABLE_OWNER VARCHAR2(30)
TABLE_NAME VARCHAR2(30)
PARTITION_NAME VARCHAR2(30)
SUBPARTITION_NAME VARCHAR2(30)
INSERTS NUMBER
UPDATES NUMBER
DELETES NUMBER
TIMESTAMP DATE
TRUNCATED VARCHAR2(3)
The most interesting of these options is the gather stale option. Because all statistics will become stale quickly in a robust OLTP database, we must remember the rule for gather stale is > 10% row change (based on num_rows at statistics collection time).