数据库表设计索引外键设计_关于索引的设计决策 数据库管理系统

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

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不提供它们。

翻译自: https://www.includehelp.com/dbms/design-decision-about-indexing.aspx

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/541078.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

接口测试从零开始系列_mock技术使用

1、什么情况下会使用mock技术 (1)需要将当前被测单元和其依赖模块独立开来,构造一个独立的测试环境,不关注被测单元的依赖对象,只关注被测单元的功能逻辑 ----------比如被测代码中需要依赖第三方接口返回值进行逻辑处…

amie 规则挖掘_AMIE的完整形式是什么?

amie 规则挖掘AMIE:工程师协会的准会员 (AMIE: Associate Member of the Institution of Engineers) AMIE is an abbreviation of Associate Member of the Institution of Engineers. The Institution of Engineers India Limited (IEIL) provides this profession…

java 马克思_单链表-Java

public class SinglyListNode {int val;SinglyListNode next;SinglyListNode() {}SinglyListNode(int x) {this.val x;}}/*执行用时:12 ms, 在所有 Java 提交中击败了66.93%的用户内存消耗:39.5 MB, 在所有 Java 提交中击败了5.06%的用户*/class MyLink…

python的pass语句_Python | 演示pass语句的示例

python的pass语句python中的pass语句 (pass statement in python) "pass" is a type of null operation or null statement, when it executes nothing happens. It is used when you want do not want to write any code/statement to execute but syntactically a …

HDS:聚焦未来的投资“冻结”

一家日本IT网站报道的有关HDS冻结对高端存储产品的投资一事引发众议。让人陷入疑惑的这次声明就是,HDS认为单纯的阵列产品并非企业存储的未来。 6月1日,IT Pro Nikkei网站发布了一篇报道,内容援引HDS一份表示将冻结高端存储业务的简报。这引发…

java js对象转字符串数组_JS数组转字符串(3种方法)【转】

JavaScript 允许数组与字符串之间相互转换。其中 Array 方法对象定义了 3 个方法,可以把数组转换为字符串,如表所示。数组方法说明toString()将数组转换成一个字符串toLocalString()把数组转换成本地约定的字符串join()将数组元素连接起来以构建一个字符…

中美共建大数据创新研究中心

由贵阳市人民政府、工信部电子一所、美国加州大学伯克利分校合作共建的贵州伯克利大数据创新研究中心日前在贵阳揭牌。 据了解,贵州伯克利大数据创新研究中心将分两阶段建设。第一阶段,2016年9月份至2017年底,将重点完成“学龄儿童大数据分析…

Python中的__init__和self是做什么的?

The __init__ and self are two keywords in python, which performs a vital role in the application. __init__和self是python中的两个关键字,在应用程序中起着至关重要的作用。 To begin with, it is important to understand the concept of class and object…

Palo Alto Networks漏洞防护扩展至云端

中国北京,2016年4月12日 –下一代安全企业Palo Alto Networks?(纽交所代码:PANW)近日宣布进一步增强其下一代安全平台,扩展漏洞防护能力,以满足那些依赖云环境和SaaS应用的业务对安全的需求。 企业机构需要变得更加灵活和有竞争力…

java 嵌套调用_Java嵌套类的使用

嵌套类是指被定义在另一个类内部的类,它为外部类提供服务。嵌套类分四种:静态成员类、非静态成员类、匿名类和局部类。一、静态成员类与非静态成员类的区别?在什么情况下可以用静态成员类?我们知道在类的设计中,为了避…

c语言getenv函数_getenv()函数与C ++中的示例

c语言getenv函数C getenv()函数 (C getenv() function) getenv() function is a library function of cstdlib header. It is used to get the environment string. It accepts a parameter which is an environment variable name (platform dependent, it may either case s…

isless()函数与C ++中的示例

C isless()函数 (C isless() function) isless() function is a library function of cmath header, it is used to check whether the given first value is less than the second value. It accepts two values (float, double or long double) and returns 1 if the first …

停牌17个月 汉能薄膜真的要复牌了?

最近,停牌超过一年的汉能薄膜又有新进展。 10月7日,路透社引述知情人士的消息称,香港证监会或将允许汉能薄膜发电复牌,不过复牌的前提是需汉能将符合一些特定条件。 该消息人士透露,证监会告知汉能,若要恢复…

hive java udf_UDF_Hive教程_田守枝Java技术博客

UDF是User-Defined Functions(用户定义函数)的简称。通过以下命令可以查看HIVE中函数的相关文档:SHOW FUNCTIONS;DESCRIBE FUNCTION ;DESCRIBE FUNCTION EXTENDED ;1、UDF函数可以直接应用于select语句,对查询结构做格式化处理后,再输出内容。…

python 示例_带有示例的Python列表remove()方法

python 示例列出remove()方法 (List remove() Method) remove() method is used to remove the first occurrence of the given element, the method is called with this list (the list from which we have to remove the element) and accepts the element to be removed as…

车联网领域,传统TSP企业做错了什么 ?

当下,车联网的定义更加丰富和宽泛,除了传统意义上的Telematics服务,数字服务、移动出行服务、电商平台等将被融入到车联网概念中,与用车相关的维修保养、洗车、代驾等第三方服务,也将成为整车厂整合的重点被纳入到车联…

gettimeofday_PHP gettimeofday()函数与示例

gettimeofdayPHP gettimeofday()函数 (PHP gettimeofday() function) gettimeofday() function is used to get the current time. gettimeofday()函数用于获取当前时间。 Syntax: 句法: gettimeofday(return_float);Parameter(s): 参数: return_floa…

Shell脚本/bin/bash^M: bad interpreter错误解决方法

2019独角兽企业重金招聘Python工程师标准>>> 在windows下保存了一个脚本文件,用ssh上传到centos,添加权限执行nginx提示没有那个文件或目录。 shell脚本放到/etc/init.d/目录下,再执行/etc/init.d/nginx,提示多了这句/…

java中map的遍历方法_Java中Map的三种遍历方式

集合中的三种遍历方式,如下代码:import java.util.Collection;import java.util.HashMap;import java.util.Iterator;import java.util.Map;import java.util.Set;import java.util.TreeMap;public class TestMap {public static void main(String[] arg…

uuid hashcode_Java UUID hashCode()方法与示例

uuid hashcodeUUID类hashCode()方法 (UUID Class hashCode() method) hashCode() method is available in java.util package. hashCode()方法在java.util包中可用。 hashCode() method is used to retrieve the hash code for this UUID. hashCode()方法用于检索此UUID的哈希码…