一 背景
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事物代码到数据库表
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.