oracle创建索引后分析表格,Oracle表与索引的分析及索引重建

1.分析表与索引(analyze 不会重建索引)

analyze table tablename compute statistics

等同于 analyze table tablename compute statistics for table for all indexes for all columns

for table 的统计信息存在于视图:user_tables 、all_tables、dba_tables

for all indexes 的统计信息存在于视图: user_indexes 、all_indexes、dba_indexes

for all columns 的统计信息存在于视图:user_tab_columns、all_tab_columns、dba_tab_columns

注:分析表与索引见 AnalyzeAllTable存储过程

2、一般来讲可以采用以下三种方式来手工分析索引。

analyze index idx_t validate structure:

analyze index idx_t compute statistics:

analyze index idx_t estimate statistics sample 10 percent

1)analyze index idx_t validate structure:

这段分析语句是用来分析索引的block中是否有坏块儿,那么根据分析我们可以得到索引的结构数据,这些数据会保留到

index_stats中,来判断这个索引是否需要rebuild. 需要注意的是这样的分析是不会收集索引的统计信息的。

2)validate structure有二种模式: online, offline, 一般来讲默认的方式是off

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值