Showing posts with label INDEXES. Show all posts
Showing posts with label INDEXES. Show all posts

Monday, 19 March 2012

How to Create Secondary Index on DSO’s in SAP BW/BI 7.x

Difference between Primary Index and Secondary Index

Index files are auxiliary file stored in database used in faster accessing of data, and it is important especially when database file size growing exponentially. Today world storage is not a problem, but retrieval/searching on certain criteria is problem.

Index files-
Secondary or auxiliary files that help speed up access in primary files

Indexes or access structure:
data structure -- data structure used for fast access.

Secondary Indexes

 
A secondary index, put simply, is a way to efficiently access records in a database (the primary) by means of some piece of information other than the usual (primary) key. In Berkeley DB, this index is simply another database whose keys are these pieces of information (the secondary keys), and whose data are the primary keys. Secondary indexes can be created manually by the application; there is no disadvantage, other than complexity, to doing so. However, when the secondary key can be mechanically derived from the primary key and datum that it points to, as is frequently the case, Berkeley DB can automatically and transparently manage secondary indexes.

Indexes

We can search a table for data records that satisfy certain search criteria faster using an index.

An index can be considered a copy of a database table that has been reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example using a binary search. The index also contains a pointer to the corresponding record of the actual table so that the fields not contained in the index can also be read.

The primary index is distinguished from the secondary indexes of a table. The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.