【性能优化】ANALYZE 与DBMS_STATS的区别

简介: From asktom-------------you can import/export/set statistics directly with dbms_statsit is easier to automate with dbms_stats (it i...
From asktom
-------------
you can import/export/set statistics directly with dbms_stats

it is easier to automate with dbms_stats (it is procedural, analyze is just a command)

dbms_stats is the stated, preferred method of collecting statisttics.

dbms_stats can analyze external tables, analyze cannot.

DBMS_STATS gathers statistics only for cost-based optimization; it does not gather other
statistics. For example, the table statistics gathered by DBMS_STATS include the number
of rows, number of blocks currently containing data, and average row length but not the
number of chained rows, average free space, or number of unused data blocks.

dbms_stats (in 9i) can gather system stats (new)

ANALYZE calculates global statistics for partitioned tables and indexes instead
of gathering them directly. This can lead to inaccuracies for some statistics, such as
the number of distinct values.  DBMS_Stats won't do that.

Most importantly, in the future, ANALYZE will not collect statistics needed by
the cost-based optimizer.

目录
相关文章
|
4月前
|
SQL 监控 关系型数据库
Trace分析优化器执行计划与Sys schema视图的使用详解
Trace分析优化器执行计划与Sys schema视图的使用详解
38 0
|
SQL 监控 关系型数据库
MySQL使用performance_schema诊断sql语句性能
Mysql数据库打开sql profile可以查看sql 语句各个阶段的性能,但仅限于当前会话中执行的sql语句。如果想要查看其它会话sql,可以使用performance_schema功能。
500 0
|
SQL 关系型数据库
PLSQL_性能优化系列18_Oracle Explain Plan解析计划通过Baseline绑定
2015-05-28 Created By BaoXinjian 一、摘要 1. 应用场景 当运行很久的Job突然出现性能问题时,并排除数据量突然变大,可能原因有执行的脚本的某些对应的SQL的解析计划变更 2.
1002 0
|
SQL Oracle 关系型数据库
PLSQL_性能优化系列16_Oracle Tuning Analyze优化分析
2014-12-23 Created By BaoXinjian 一、摘要 SQL是的全称是Structured Query Language(结构化查询语言)。SQL是一个在80年代中期被使用的工业标准数据库查询语言。
1146 0
|
SQL Oracle 关系型数据库
PLSQL_性能优化系列15_Oracle Explain Plan解析计划解读
2014-12-19 Created By BaoXinjian 一、摘要 在SQL语句的执行计划中,包含很多字段项和很多模块,其不同字段代表了不同的含义且在不同的情形下某些字段、模块显示或不显示,下 面的描述给出了执行计划中各字段的含义以及各模块的描述。
1037 0
|
SQL 关系型数据库 数据库
PLSQL_性能优化系列08_Oracle Insert / Direct Insert性能优化
2014-09-25 Created By BaoXinjian 一、Insert 性能影响 应用设计不合理导致的session之间的互锁(enqueue)是影响程序可扩展性最常见的原因。此外,一些共享资源的争用,也会导致性能下降。
1046 0