User Guide
SAP AG November 2002
Secondary Key
Secondary keys can be defined for each table to optimize the data access via SQL
statements. They can refer to any column combination and they help to prevent sequential
scans over the table. Like the primary key [Page 101], the secondary key can consist of
multiple columns.
A secondary key is often called an index (not to be confused with B* index).
B* Tree
All SAP DB data is stored in structures called B* trees. The B* tree method is far more
efficient for accessing the rows of a table than other access methods (for example, sequential
scans).
A B* tree spans several levels from the root level at the top, to the index levels, through to
the lowest leaf level (one root level, n index levels (n>=1), one leaf level).
The storage units are called pages or data pages. SAP DB Version 7 supports a page size of
8 KB.
In SAP DB Version 7, all subsequent comparisons in a B* tree use ASCII code (each
character is assigned a numerical value between 0 and 255). The comparisons are performed
for all values on a character-by-character basis.
The sort criterion for building a B* tree is the primary key [Page
101].
B* Tree
Wa
An
Au Az Baf ... ... Bi
Waf
...
..
Zu
Aalen Amiens Anizy Athens Auber Avon
Ba
.. .. ..
Root level
Index level
Leaf level
See also:
Root/Index Page [Page
103]
Leaf Page [Page
103]
Table Access [Page 103]
User Manual: SAP DB 102










