按非 pk 字段索引 Oracle IOT

发布于 2024-08-03 06:13:14 字数 203 浏览 1 评论 0原文

我在 SQL Server 中有一个表,需要将其正常的 pk 索引替换为两个字段上的聚集索引。这些其他字段不是主键的一部分。

我需要在 Oracle 中做类似的事情。据我所知,这可以使用索引排序表来完成,但我的猜测是这些索引仅在主键上构建。

有什么方法可以在 Oracle 中获得与 SQLServer 聚集索引类似的行为吗?

I have a table in SQL Server that needs its normal pk index to be replaced by a clustered index on two fields. These other fields are not part of the primary key.

I need to do something similar in Oracle. As far as I know, this can be done using index-ordered tables, but my guess is these indexes are only constructed on the primary key.

Is there any way I can get a similar behavior to SQLServer's clustered index in Oracle?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠北森屋 2024-08-10 06:13:14

索引组织表是oracle的概念,类似于sql server中的聚集索引。我在中找到了关于该主题的讨论 Oracle 论坛和 asktom< 上的一个/a>.

我的问题是:你为什么要调整这种行为?您想获得什么好处?

sql server中的聚集索引大多是主键索引。行数据存储到索引节点中。 oracle 将行数据存储到索引中的概念是索引组织表。
在 oracle 上,iot 用于避免在索引查找后再次在表中查找行数据。

SQL Server上聚集索引的目的是存储行数据。一张表只能有一个聚集索引。该索引将保存行数据。任何其他索引都是非聚集索引。

恕我直言,聚集索引的概念与sql server数据存储绑定在一起,无需在oracle中重建此行为。 Oracle 还有其他存储数据的概念。

答案:
oracle上的常规索引就可以解决你的问题。

Index organized tables are the concept of oracle which is near to clustered indexes in sql server. I found a discussion about the topic in oracle forum and one on asktom.

My question is: why do you want to adapt the behavior? What is the benefit you whant to obtain?

A clustered index in sql server is mostly the primary key index. Rowdata is stored into the index node. The conecpt on oracle to store row data into the index is an index organized table.
On oracle the iot is used to avoid a second lookup for row data into the table after index lookup.

The purpose of clustered index on sql server is to store the rowdata. A table can have only one clustered index. This index will hold the rowdata. Any other index is a non clustered index.

IMHO the concept of clustered index is bound to sql server data storage and there is no need to rebuild this behavior in oracle. Oracle has other concepts to store data.

Answer:
A regular index on oracle is all to solve your problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文