Inde
Inde
Inde
The utilization of indexes can dramatically reduce the execution time of various
operations such as select and join.
Dense Index: In this case, indexing is created for primary key as well as on the columns
on which we perform transactions.
That means, user can fire query not only based on primary key column. He can query
based on any columns in the table according to his requirement.
But creating index only on primary key will not help in this case. Hence index on all the
search key columns are stored.
Each index record’s data-file pointer points to the first data-file record with the search
key value.
Or
In order to address the issues of dense indexing, sparse indexing is introduced. In this
method of indexing, range of index columns store the same data block address. And
when data is to be retrieved, the block address will be fetched linearly till we get the
requested data.
Primary index is classified into two types : Dense Index and Sparse Index.
Dense index
•For every search key
value in the data file,
there is an index
record.
•Index records contain
search key value and a
pointer to the actual
record on the disk.
•The index record appears only for a few items in the data file. Each item points to a block
as shown.
•To locate a record, we find the index record with the largest search key value less than or
equal to the search key value we are looking for.
•We start at that record pointed to by the index record, and proceed along the pointers in
the file (that is, sequentially) until we find the desired record.
•Primary Index: Primary index is defined on an ordered data file. The data file
is sorted according to a key field. The key field is generally the primary key of the
relation.
Clustering Index: Clustering index is defined on an ordered data file. The data file is
ordered on a non-key field.
Secondary Index
References
Avi Silbershatz, Hank Korth and S. Sudarshan. Database System Concepts, 4th Edition. McGraw-Hill, 2002.