楼主: chao_ping

[精华] 讨论:When To Index And How Index

[复制链接]
论坛徽章:
0
31#
发表于 2002-6-6 14:41 | 只看该作者

补充关于函数索引

init.ora中的compatible参数要设成8.1.6以上,用户建立function based index还要有qurey rewrite权限
如果缺省的优化模式是RBO,还可以使用/*+ first rows */ 或者 /*+ all rows */来强制使用函数索引。

null值是不能使用索引的,如果字段中有大量的NULL值,想要使用索引范围扫描,最好还是把NULL替换成一个其他的字符什么的。

有时候检索大表中大量的数据,(例如返回80%的数据)索引就起不了什么作用了,这时候如果机器硬件允许,可以做并行查询,用双提示/*+ FULL(tablename) PARALLEL(tablename,数值) */
由于硬件环境所限制,并行查询我用的也不多。在此抛砖引玉,望高手指点。

使用道具 举报

回复
论坛徽章:
20
ITPUB元老
日期:2005-02-28 12:57:002012新春纪念徽章
日期:2012-02-13 15:10:582012新春纪念徽章
日期:2012-02-13 15:10:582012新春纪念徽章
日期:2012-02-13 15:10:582012新春纪念徽章
日期:2012-02-13 15:10:58马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有对象
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:10:58
32#
发表于 2002-6-6 16:30 | 只看该作者
When to drop an index, if you are using Oracle9i, you can turn on the Index Monitor for a few days, if the index has never been used, then it should be dropped.
---- But, believe it or not ---
a dropped index may affect other SQL statements’ execution plan although the original plan was not using the index. So, the overall SQL performance may be changed out of your expectation.  
I used DB Expert to test one of our systems in these few weeks, I found that some SQL statements was not using a specific index originally, but once a specific index was dropped, the execution plan may changed.  It is a very interest founding I have never imagined before!  I am using Oracle 9i and keep multiple SQL in Plan Version Tracker; I drop an index on in Pre-script in Plan Version Tracker and take a new Snapshot, then I recreate the Index on Post-script.  I found some SQL’s execution plan were change although the original plans were not using that index.   Please share with us if you find the same Oracle problem!

使用道具 举报

回复

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

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表