博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
数据库表设计索引外键设计_关于索引的设计决策 数据库管理系统
阅读量:2532 次
发布时间:2019-05-11

本文共 3522 字,大约阅读时间需要 11 分钟。

数据库表设计索引外键设计

Introduction:

介绍:

The attributes whose values are required inequality or range conditions and those that are keys or that participate in join conditions require access paths.

其值为必需的不等式或范围条件的属性以及作为键或参与联接条件的属性需要访问路径。

The performance of queries largely depends upon what indexes or hashing schemas exist to expedite the processing of selections and joins. On the other hand, when we do insertion, deletion, or updating operations, the existence of indexes adds to the overhead. This overhead need to be justified in terms of the increase in efficiency by expediting queries and also the transactions.

查询的性能很大程度上取决于存在哪些索引或哈希模式以加快选择和联接的处理。 另一方面,当我们执行插入,删除或更新操作时,索引的存在会增加开销。 需要通过加快查询以及事务的效率来证明这种开销。

The physical design decision for indexing falls into the following categories:

索引物理设计决策可以归为以下几类

1)是否也索引属性 (1) Whether too index an attribute)

The attribute must be a key or there must be some query that uses that attribute either in a selection condition or in a join. One factor.

该属性必须是键,或者必须存在一些在选择条件或联接中使用该属性的查询。 一个因素。

In favor of setting up many indexes is that some queries can be processed by just scanning the indexes without retrieving any data.

设置许多索引的好处是可以通过仅扫描索引而无需检索任何数据来处理某些查询。

2)要索引哪些属性或属性 (2) What attributes or attributes to index on)

An index can be constructed one or multiple attributes. If there are multiple attributes from one relation that are involved together in several queries,

索引可以构造一个或多个属性。 如果一个查询中有多个属性同时包含在多个查询中,

A multiattribute index is warranted. The ordering of attributes within a multiattribute index must correspond to the queries. For example, the above index assumes that queries would be based on an ordering of colors within a GARMENT_style_ #rather than vice-versa.

多属性索引是必要的。 多属性索引中的属性顺序必须与查询相对应。 例如,以上索引假设查询将基于GARMENT_style_#内的颜色顺序,而不是相反。

3)是否建立聚簇索引 (3) Whether to set up a clustered index)

At most, one index per table can be primary or clustering index because this implies that the file is physically ordered on that attribute. In most RDBMS this is specified by the keyword CLUSTER.

每个表最多只能有一个索引是主索引或聚簇索引,因为这意味着该文件在该属性上是物理排序的。 在大多数RDBMS中,这由关键字CLUSTER指定。

If a table requires several indexes, the decision about which one should be a clustered index depends upon whether keeping the table ordered on that attribute is needed. Range queries benefit a great deal from clustering. If several attributes require the range queries, relative benefits must be evaluated before deciding which attribute to cluster on. A clustering index may be set up as a multi-attribute index if range retrieval by that composite key is useful in report creation.

如果一个表需要多个索引,则关于哪个索引应为聚集索引的决定取决于是否需要将该表保持在该属性上。 范围查询从群集中受益匪浅。 如果几个属性需要范围查询,则必须在确定要聚类的哪个属性之前评估相对利益。 如果该复合键的范围检索在报表创建中很有用,则可以将聚类索引设置为多属性索引。

4)是否在树索引上使用哈希索引 (4) Whether to use a hash index over a tree index )

In general, RDBMS use B+ trees for indexing. However, ISAM and hash indexes are also provided in some systems.B+ trees support equality and range queries on the attribute used as the search key. Hash indexes work very well with equality conditions, to find a matching record during joins.

通常,RDBMS使用B +树进行索引。 但是,某些系统中还提供了ISAM和哈希索引.B +树支持对用作搜索关键字的属性进行相等性和范围查询。 哈希索引在相等条件下可以很好地工作,可以在联接期间找到匹配的记录。

5)是否对文件使用动态哈希 (5) Whether to use dynamic hashing for the file)

For files that are very volatile, that is those that grow and shrink continuously one of the dynamic hashing schemas would be suitable. Currently, they are not offered by commercial RDBMSs.

对于非常易失的文件,即那些不断增长和缩小的文件,动态哈希方案之一将是合适的。 当前,商业RDBMS不提供它们。

翻译自:

数据库表设计索引外键设计

转载地址:http://nttzd.baihongyu.com/

你可能感兴趣的文章
图论知识,博客
查看>>
[原创]一篇无关技术的小日记(仅作暂存)
查看>>
20145303刘俊谦 Exp7 网络欺诈技术防范
查看>>
原生和jQuery的ajax用法
查看>>
iOS开发播放文本
查看>>
20145202马超《java》实验5
查看>>
JQuery 事件
查看>>
main(argc,argv[])
查看>>
在线教育工具—白板系统的迭代1——bug监控排查
查看>>
121. Best Time to Buy and Sell Stock
查看>>
hdu 1005 根据递推公式构造矩阵 ( 矩阵快速幂)
查看>>
安装php扩展
查看>>
百度移动搜索主要有如下几类结果构成
查看>>
Python爬虫面试题170道:2019版【1】
查看>>
JavaBean规范
查看>>
第四阶段 15_Linux tomcat安装与配置
查看>>
NAS 创建大文件
查看>>
学习笔记-模块之xml文件处理
查看>>
接口测试用例
查看>>
面试:用 Java 实现一个 Singleton 模式
查看>>