索引分析
索引分析
select
idx.owner owner,
idx.table_name tablename,
idx.index_name index_name,
idx.blocks idx_blocks,
tbl.blocks tbl_blocks,
trunc(idx.blocks/tbl.blocks*100)/100 pct
from
(select i.owner owner ,i.index_name index_name,
SUM(S1.blocks) blocks,i.table_owner table_owner,
i.table_name table_name
from dba_segments s1,dba_indexes i
where
s1.owner=i.owner and s1.segment_name=i.index_name and
i.owner not in('SYS','SYSTEM')
GROUP BY i.owner ,i.index_name ,i.table_owner , i.table_name ) idx,
(select t.owner owner ,t.table_name table_name,SUM(s2.blocks) blocks from dba_segments s2,dba_tables t where
s2.owner=t.owner and s2.segment_name=t.table_name and
t.owner not in ('SYS','SYSTEM')
GROUP BY T.OWNER,T.TABLE_NAME
) tbl
where
idx.table_owner=tbl.owner and
idx.table_name=tbl.table_name and
(idx.blocks/tbl.blocks)>0.5 and
idx.blocks>200
order by 4
/
select
idx.owner owner,
idx.table_name tablename,
idx.index_name index_name,
idx.blocks idx_blocks,
tbl.blocks tbl_blocks,
trunc(idx.blocks/tbl.blocks*100)/100 pct
from
(select i.owner owner ,i.index_name index_name,
SUM(S1.blocks) blocks,i.table_owner table_owner,
i.table_name table_name
from dba_segments s1,dba_indexes i
where
s1.owner=i.owner and s1.segment_name=i.index_name and
i.owner not in('SYS','SYSTEM')
GROUP BY i.owner ,i.index_name ,i.table_owner , i.table_name ) idx,
(select t.owner owner ,t.table_name table_name,SUM(s2.blocks) blocks from dba_segments s2,dba_tables t where
s2.owner=t.owner and s2.segment_name=t.table_name and
t.owner not in ('SYS','SYSTEM')
GROUP BY T.OWNER,T.TABLE_NAME
) tbl
where
idx.table_owner=tbl.owner and
idx.table_name=tbl.table_name and
(idx.blocks/tbl.blocks)>0.5 and
idx.blocks>200
order by 4
/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25462274/viewspace-2124953/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 索引分析及索引重建Oracle索引
- 分析索引快速獲取索引資訊索引
- 【索引】使用索引分析快速得到索引的基本資訊索引
- [轉]:bitmap索引和B*tree索引分析索引
- MongoDB索引,效能分析MongoDB索引
- MySQL索引效能分析MySql索引
- MySQL的索引分析MySql索引
- 分析索引是否有效索引
- Oracle表與索引的分析及索引重建Oracle索引
- oracle 表分析和索引Oracle索引
- 分析RavenDB的索引功能索引
- 分析索引是否變'壞'索引
- Analyze分析表或者索引索引
- Oracle表與索引的分析及索引重建(轉)Oracle索引
- 分析index降低索引層次Index索引
- 2 mysql索引優化分析MySql索引優化
- ORACLE 組合索引 使用分析Oracle索引
- Oralce中分析表及索引索引
- oracle 定期表及索引分析Oracle索引
- 索引的分析和比較索引
- MySQL 索引 效能分析 show profilesMySql索引
- MySQL的索引優化分析(一)MySql索引優化
- MySQL的索引優化分析(二)MySql索引優化
- Oracle對索引分析的優化Oracle索引優化
- IndexPatternService 模糊查詢索引 fuzzyQuery分析Index索引
- 一文總結分析聚集索引、非聚集索引、覆蓋索引的工作原理!索引
- 資料庫索引分裂 問題分析資料庫索引
- Elasticsearch核心技術(四):索引原理分析Elasticsearch索引
- mongodb索引及查詢優化分析MongoDB索引優化
- Oracle對錶、索引和簇的分析Oracle索引
- SQL Server 索引使用分析 - SARG(Searchable Arguments)SQLServer索引
- 索引在ORACLE中的應用分析索引Oracle
- ORACLE分析表和索引的指令碼Oracle索引指令碼
- 跳槽必看MySQL索引:B+樹原理揭秘與索引優缺點分析MySql索引
- mysql 執行計劃索引分析筆記MySql索引筆記
- oracle聯合索引在CBO下的分析Oracle索引
- oracle的B-tree索引結構分析Oracle索引
- 面試必備之MYSQL索引底層原理分析面試MySql索引