免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2072 | 回复: 7
打印 上一主题 下一主题

oracle 表的索引 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-18 10:03 |只看该作者 |倒序浏览
20可用积分
现在表的大小是10个普通字段(VARCHAR2,NUMBER,没有LOB),几万条记录,可以不加索引。

如果将来表增长到千万条记录级,到时候(也许两年后),再在表上建索引,可以吗?到时候建立的索引,会自动把表中所有的数据都“索引”吗?

最佳答案

查看完整内容

会的。以下引自tom kyte的一段话:我 常常发现,人们在应用开发中总是事后才想起索引。我坚持认为这是一种错误的做法。如果你知道数据将如何使用,从一开始就应该能提出应用中要使用怎样的索 引,即具有一组代表性的索引。不过,一般的做法却往往是随应用“放任自流“,过后才发现哪里需要索引,这种情况实在太多了。这说明,你没有花时间来了解数 据将如何使用以及最终要处理多少行。经过一段时间后,随着数据量的增长,你会不停 ...

论坛徽章:
1
丑牛
日期:2014-08-07 17:07:05
2 [报告]
发表于 2009-09-18 10:03 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
3 [报告]
发表于 2009-09-18 10:28 |只看该作者

回复 #2 ILoveMK 的帖子

呵呵!!
精辟!

论坛徽章:
0
4 [报告]
发表于 2009-09-18 10:29 |只看该作者
嗯,你这里的是译文,是哪里来的?
英文地址也可以,这段话哪里来的。。。

论坛徽章:
1
数据库技术版块每日发帖之星
日期:2016-01-24 06:20:00
5 [报告]
发表于 2009-09-18 11:03 |只看该作者

回复 #4 TOADLover 的帖子

应该来自于《oracle9i&10g编程艺术》一书……

论坛徽章:
1
丑牛
日期:2014-08-07 17:07:05
6 [报告]
发表于 2009-09-18 11:17 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
7 [报告]
发表于 2009-09-18 13:32 |只看该作者
嗯,谢谢两位!
-----------------------
In order to understand wht is a clustered index in oracle it is imp. to know what is a cluster.

A cluster is a method to store data for more than 1 table in the same block.

This can be compared to a condition where we have a join condtion of 2 tables(primary key of one is the foreign key in other).

Under such conditions we need to index the cluster i.e. which data segment belongs to which table.

Such type of clustering is Indexed clusetering in oracle. 这个说的是索引簇,好像不是索引?

Plz make a note that clustered index has some other meaning in other data base esp. Sybase
--------------------------
按照这里的说法,cluster index是不可能创建在普通表上的了?
---------------------------

[ 本帖最后由 TOADLover 于 2009-9-18 13:34 编辑 ]

论坛徽章:
0
8 [报告]
发表于 2009-09-18 13:37 |只看该作者
A cluster index is unlike a table index in the following ways:
----------------------------------------------------------------------------
1. Keys that are all null have an entry in the cluster index.
2. Index entries point to the first block in the chain for a given cluster key value.
3. A cluster index contains one entry per cluster key value, rather than one entry per cluster row.
4. The absence of a table index does not affect users, but clustered data cannot be accessed unless there is a cluster index.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP