首页 > Linux操作系统 > Linux操作系统 > dbms_stats包的使用误区
SQL> select count(*) from wl;
COUNT(*)
----------
29676
SQL> delete from wl where rownum<10000;
已删除9999行。
SQL> commit;
提交完成。
SQL> select count(*) from wl;
COUNT(*)
----------
19677
SQL> select last_analyzed,empty_blocks from user_tables where table_name='WL';
LAST_ANALYZED EMPTY_BLOCKS
------------------- ------------
SQL> exec dbms_stats.gather_table_stats('test','wl');
PL/SQL 过程已成功完成。
SQL> select last_analyzed,empty_blocks from user_tables where table_name='WL';
LAST_ANALYZED EMPTY_BLOCKS
------------------- ------------
2009-02-01 16:51:30 0
SQL> analyze table wl compute statistics;
表已分析。
SQL> select last_analyzed,empty_blocks from user_tables where table_name='WL';
LAST_ANALYZED EMPTY_BLOCKS
------------------- ------------
2009-02-01 16:51:51 106
这是metalink上对该字段统计不一样的解释:Dbms_stats performs differently with analyst statement, the output will be different.
Empty_blocks in dba_tables is the number of blocks that are allocated but were never used. These blocks will not be read anyway as it is beyond the high water mark.
Avg_space and Avg_space_freelist_blocks are use for space management and inserts, it does not affect the optimi
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/18862428/viewspace-544972/,如需转载,请注明出处,否则将追究法律责任。