ITeye博客

表分析语句

hotjava · 2008-04-10 17:13 · 数据库 · Markdown

Exec dbms_stats.gather_schema_stats(ownname=>'用户名称',estimate_percent=>100,cascade=> TRUE, degree =>12);

含义解释 ownname:填写需要分析的用户(该用户下所有表都将被分析)
          estimate_percent:分析抽样的力度
          cascade:是否对索引进行分析
          degree:并行处理的cpu数量

对单个表做分析推荐使用 analyze table 表名 compute statistics;(将会把表下的索引一起分析) 对单个索引进行分析推荐使用 analyze index 索引名 compute statistics;

当然对单个表或者索引的分析也可以采用

    dbms_stats.gather_index_stats

dbms_stats.gather_table_stats (exec dbms_stats.gather_table_stats(ownname=>'hbsps',tabname=>'fail_reason',estimate_percent=>100,cascade=> TRUE); )

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。