12
返回列表 发新帖
楼主: 小新

有人能谈谈反向索引吗?没搜到相关的帖子啊。

[复制链接]
论坛徽章:
7
ITPUB元老
日期:2005-10-27 20:45:16会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10数据库板块每日发贴之星
日期:2011-06-09 01:01:01数据库板块每日发贴之星
日期:2011-07-28 01:01:01ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41
11#
发表于 2005-2-4 10:51 | 只看该作者
我也共享一下吧
Definition,Creating a reverse key index reverses the bytes of each column key value. In the case of a composite key the column order is kept, but the bytes of each column are reversed.
定义,建立一个反向索引将把每个列的键值(each column key value)按字节反向过来,对于组合键,列的顺序被保留,但每个列的字节都作了反向。
When to Create Reverse Key Indexes,An ever-increasing key (such as sequential numbers for invoices, employee ids, or order numbers) repetitively degrades the index height (BLEVEL statistic); you can avoid forced block splits by spreading the index entries more evenly.
什么时候建立反向索引,当索引是从序列中取的时候,如果是一般的b-tree 索引,在大量的插入后会导致块的分裂以及树的倾斜,使用reverse key index可以使索引段条目被更均匀的分布。
Disadvantage,When application statements specify ranges then the reverse key index cannot be used, because the keys are not in sequential order. In this case the CBO will choose an explain plan that uses a full table scan.
缺点,当应用需要获取一段范围的数据时,reverse key index将不会被使用,因为键值不是连续的排列的。在这种情况下,CBO将会选择全表扫描。

使用道具 举报

回复
论坛徽章:
131
2006年度最佳技术回答
日期:2007-01-24 12:58:48福特
日期:2013-10-24 13:57:422014年新春福章
日期:2014-02-18 16:41:11马上有车
日期:2014-02-18 16:41:11马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有对象
日期:2014-02-19 11:55:14马上加薪
日期:2014-02-19 11:55:142013年新春福章
日期:2013-02-25 14:51:24
12#
发表于 2005-2-4 11:12 | 只看该作者

为什么大家都觉的
1234的reverse 是 4321 呢

[php]
sys@test> var a number
sys@test> exec :a := 1234
  1* select dump(:a) ,dump(reverse(:a)),:a,reverse(:a) from dual
sys@test> /

DUMP(:A)
--------------------------------------------------------------------------------
DUMP(REVERSE(:A))
--------------------------------------------------------------------------------
        :A REVERSE(:A)
---------- -----------
Typ=2 Len=3: 194,13,35
Typ=2 Len=3: 35,13,194
      1234  -8.800E+55

sys@test>
[/php]

使用道具 举报

回复
论坛徽章:
7
ITPUB元老
日期:2005-10-27 20:45:16会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10数据库板块每日发贴之星
日期:2011-06-09 01:01:01数据库板块每日发贴之星
日期:2011-07-28 01:01:01ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41
13#
发表于 2005-2-4 11:27 | 只看该作者
呵呵,这样就很清楚了
bytes of each column are reversed

使用道具 举报

回复

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

本版积分规则 发表回复

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