查看列的和行的统计信息 & 查看索引的统计信息

查看列的和行的统计信息

select a.column_name,
       b.num_rows,
       a.num_nulls,
       a.num_distinct Cardinality,
       round(a.num_distinct / b.num_rows * 100, 2) selectivity,
       a.histogram,
       a.num_buckets
  from dba_tab_col_statistics a, dba_tables b
 where a.owner = b.owner
   and a.table_name = b.table_name
   and a.owner = 'SCOTT'
   and a.table_name = 'T_STATS';

查看索引的统计信息

select blevel, leaf_blocks, clustering_factor,status
  from dba_indexes
 where owner = 'SCOTT'
   and index_name = 'IDX_T_STATS_ID';

 

posted @ 2023-03-07 22:55  屠魔的少年  阅读(3)  评论(0)    收藏  举报