主索引和次索引之间有什么区别? [英] What is difference between primary index and secondary index exactly?

查看:395
本文介绍了主索引和次索引之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我什么是主索引&二级指数?
什么是不同的索引,属于初级&二级指数?
使用主索引比二级索引的优点是什么?反之亦然?

解决方案

主索引



主索引是一组字段上的索引,包括
字段的唯一主键,并且保证不包含重复项。
也称为聚簇索引
eg。员工ID可以是它的例子。



次要索引

次要索引是不是主索引,可能有重复。
eg。员工姓名可以是它的例子。因为Employee名称可以具有类似的值。



主索引包含表的关键字段。激活表时,将在数据库中自动创建主索引。如果经常访问大型表,以致无法应用主索引排序,则应为该表创建辅助索引。



表上的索引具有三字符索引ID。 0保留用于主索引。客户可以在SAP表上创建自己的索引;其ID必须以Y或Z开头。


Can any one tell me what's the exact difference between Primary index & Secondary index? What are the different indexes that comes under category of primary & secondary index? And what's advantages of using primary index over secondary index & vice versa?

解决方案

Primary index:

A primary index is an index on a set of fields that includes the unique primary key for the field and is guaranteed not to contain duplicates. Also Called a Clustered index. eg. Employee ID can be Example of it.

Secondary index:

A Secondary index is an index that is not a primary index and may have duplicates. eg. Employee name can be example of it. Because Employee name can have similar values.

The primary index contains the key fields of the table. The primary index is automatically created in the database when the table is activated. If a large table is frequently accessed such that it is not possible to apply primary index sorting, you should create secondary indexes for the table.

The indexes on a table have a three-character index ID. '0' is reserved for the primary index. Customers can create their own indexes on SAP tables; their IDs must begin with Y or Z.

这篇关于主索引和次索引之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆