INTRODUCTION TO INDEXING AND ITS TYPES

INTRODUCTION TO INDEXING AND ITS TYPES

In the previous article we’ve discussed about non-serializable schedule and its types. In this section we’ll study about INTRODUCTION TO INDEXING AND ITS TYPES. Indexing is use to optimize the performance of database. By minimizing the number of disc accesses require when a query is process. Also index is a type of data structure. It is use to locate and access the data in the database quickly. furthermore continuing our article INTRODUCTION TO INDEXING AND ITS TYPES.

TYPES OF INDEXING

  • Ordered indexes
  • Primary indexes
  • Clustered indexes
  • Secondary indexes
ORDERED INDEXES:

These are usually sorted to make searching faster. Hence, the indexes which are sort are call as ordered indices.

PRIMARY INDEXES:

Additionally if the index created on the basis of primary key of the table. Then it is call as primary indexing. These primary keys are unique to each record. And 1:1 relation between records. In summary Search time= (log N +1) where N= no. of blocks in index. It is classified into two:

  1. Dense index: The dense index contains an index record. For every every search key value in the data file. Truly, It makes searching faster. In this , number of records in the index table is same as the number of record in the main table.
  2. sparse index: In the data file index record appears only for a few items. Each item points to a block. Hence, If data is sorted ,its better to use sparse index. Also Number of entries in index table = number of blocks in hard disk.
CLUSTERED INDEX:

It is Ordered data file but sometimes the index is created on non primary key columns. Which may not be unique for each record. In this case. To identify the record faster. We will group two or more columns to get the unique value. And creating index out of them . This method is call as clustering index.

we’ll study furthermore in next article.