今天看到一个SQL执行数比平时很搞,走的的全表扫描。写了如下查询语句,查找了表上的索引及对应的字段等。
SQL> select count(*) from abc;
COUNT(*)
----------
189069
SQL> select i.owner,i.index_name,c.column_name,i.index_type,i.clustering_factor,i.num_rows
2 from dba_indexes i,dba_ind_columns c where i.table_name=c.table_name
3 and i.index_name=c.index_name and i.table_name='abc';
[@more@]该语句根据当时灵感写出来的,其中根据CLUSTERING_FACTOR 和NUM_ROWS的对比我们可以初步判断哪些索引碎片严重需要重建等信息。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/18841027/viewspace-1052540/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/18841027/viewspace-1052540/