You are on page 1of 8

Purpose

Dos & Dont while creating


secondary indexes.

Understanding DB05 to check


index performance.

Fields to be included and


excluded in secondary index.

Table analysis transactions


TAANA
What to keep in mind for Secondary Indexes

Dos
Make sure secondary index is created only if there is
strong case for the need.

Max. 5 fields recommended in any index

The field or fields of the new secondary index should


result in almost 4-5% of the total number of table entries
to be highly efficient. Otherwise it is not worth creating
the index.

When table alias is used in a join-statement make sure


that you use the alias in the hint.
Ex: VBAK as A inner join VBAP as B
%_HINTS ORACLE 'INDEX(B" "VBAP~Z02")'.
What to keep in mind for Secondary Indexes

Donts
Avoid using negation operators like NE or
complex where clause involving BETWEEN,
complex patterns with like A%B.

Always go for EQ operator and avoid too many


joins.

Do not add frequently changed fields in the


record example : status, qty or amount fields.
and fields where the values could be blank.

Avoid overlapping and too many indexes which


can drag the update operations.
DB05 Analyzing Table index fields
DB05 shows you the number of distinct values and
the distribution of values.

Determine the cardinality of column combinations.


.
This answer the question as to which the adding of
another column to the index actually increases the
selectivity of the index.

Selectivity: Determined by the number of different


values of field in the whole table. The more distinct
values, the better is the index.

The numbers to the right under the areas101-


1000...100,101-1,000,000 etc refers to the no. of hits
occurs so many times to access the entry.

Conclusion : Target for higher distinct values and lower


values on the search areas to have an efficient index
on DB table.
Rule based optimizer v/s Cost based
optimizer
Which index is used?
Rule based optimizer: The number of fields given in a where
condition was used by the rule based optimizers to decide
which index should be used.
Rule based optimizers know nothing about selectivity.
Cost-based optimizer: It use selectivity (statistics are held and
updated for a each index). The selectivity of the index fields
which are given in the where condition is calculated, the index
with the highest selectivity is used.
More often cost based optimizer is used in ABAP so the index
with high selectivity is used over index with low selectivity field.
TAANA for Table analysis

Very useful for migration project or closing of any


plant or factories.
.
Create variant in TAANA for group of columns to
know the distinct values and combinations for each
unique values.

Help you in doing impact analysis in case of any


change in KDS like sales org or plant level.

Useful in estimating the efforts required for setting up


configuration for new rollouts.

Can be used as input before creating secondary


indexes.
Any questions / comments ?

Does MANDT is mandatory while


creating secondary index?

Does the sequence of fields matter in


selection of index?

Security Level
Initials/YYYY-MM-DD /7
Thank you

You might also like