SAP 自建数据库表的索引

一 背景

An index in a database table helps to speed up the selection of rows. An index is a sorted copy of selected database table fields. An additional field contains a pointer to the actual table rows. Sorting enables faster access to the rows in the table, for example in binary searches. A database table has at least one primary index defined by its key fields. It can also have one or more optional secondary indexes.
The primary index is a unique index constructed from the key fields of the primary key. It is always created automatically in AS ABAP. A maximum of one record exists in the table for each combination of index fields. If the primary index cannot be used to identify the results set, for example because no field from the primary index was selected, the table is scanned in full or an attempt is made to use a suitable secondary index (if one exists).
Alongside the primary index defined using the primary key, both unique and non-unique secondary indexes can be created for a database table. Creating secondary indexes usually improves the performance of database reads that evaluate the indexes of the database.
索引,在自建表中,有时候查询非常慢,就需要对相应的字段做索引,以下是我对做索引前和索引后做的一个对比(速度从30多秒到查询不到1秒).

做索引前
在这里插入图片描述
所索引后
在这里插入图片描述

二 方法
2.1通过SE11事物代码到数据库表

做索引前,应该SQL查询速度是否慢,方法.
在这里插入图片描述

2.2 点创建索引

在这里插入图片描述
一般自建表的索引应该是用的第一个索引;然后第二个索引应该是标准表可以用的,然后也是备用索引.

2.3 命名

在这里插入图片描述

2.4 找到相应的字段

在这里插入图片描述

2.5 写描述,然后找出相应的字段;

在这里插入图片描述

三 总结

In the fact , I don’t add any index. If you add it . it takes up more disk.

扩展索引

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值