索引失效的问题

[复制链接]
查看11 | 回复9 | 2005-2-28 12:57:00 | 显示全部楼层 |阅读模式
昨晚刚刚对一个分区的大表(有1000万)建了几个索引,这些索引都是建在该表的单独的某一列上,分别create index 之后,然后执行:
analyze table aaa estimate statistics for tablefor all indexed columns
,这些索引都是建在同一表空间上.
然后检查是否能利用索引(oracle 8i),
set autot traceonly;
select* from aaa where column1=1;
发现执行计划利用了该索引,结果很快.
第二天一早,就发现该索引不能被利用了,问题是一共6个索引,其他四个索引都没有问题,唯独其他两个索引不能用了,即使用
select/* + index aaa(columns1) */ * from aaa where columns1=1;也做全表扫描,而不是利用索引.
检查过dba_indexes中的字段也没有发现可疑之处,毕竟这几个索引的参数都差不多,为什么其中的两个不行?
执行analyze index validate structure,观察index_stat也没发现什么不妥的地方,
在索引失效之前,该表并没有执行多少dml语句.
现在没有了思路,该如何解决该问题?thanks
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
/* +
中间没有空格的
看看OS上有没有什么问题
必要的时候rebuild your index
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
select index_name,status from user_indexes;
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
其实该索引都drop,然后creat index 都n次了,都不管用,
你说查OS,能否详细点,I'm not good at OS,thanks
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
不会吧
你recreate index都没有用???
A U SURE?
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
Yes ,I'm sure.
奇怪的就是为什么其中两个索引不行,其他4个却可以.
估计不是重不重建的问题.因为我感觉创建后,对表没有
操作多少,那两个索引马上不管用了,其他的4个依然ok.
我实在不知从哪里着手分析了.thankyou.
Is there something with OS?
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
1. Check the index status in dict
2. Check alert.log file
3. Check OS log file /var/adm/messages etc
有疑点吗?
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
将你的执行计划贴出来。
我感觉实际上跟你上面描述的,有出入
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
I have examined views user_indexes andindex_stats(after execute analyze index validate structure),
there is no quesionalbe value and columns STATUS=VALID;
there is no correspondent error or information in alert_log.ora;
I don't find out var/adm/messages etc ,this need root privilege? I have not .
Of course,maybe there are some important message and I can't find out within my poor level.
Can you give some suggesions or notice? thanks !
回复

使用道具 举报

千问 | 2005-2-28 12:57:00 | 显示全部楼层
select * from aaa where column1=1;
?你的Column1列什么数据类型,
换个语句试试看。你弄那么多索引干吗啊?
不能使用索引原因很多,你的那个列上有没有Null值,其他的原因别人补充吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行