1.

What do you understand about indexing in the context of Database Management Systems (DBMS)? What are the different types of indexing?

Answer»

Indexing is a data structure approach for retrieving records fast from a database file. A short table with only two COLUMNS is called an index. A duplicate of a table's primary or candidate key APPEARS in the first column. The second column of the table comprises a series of pointers that carry the address of the disk block where that particular key value is stored. An index takes a search key as input and returns a collection of matching records.
In the real world, we can compare indexing with that of the index page of a page. To access the content of a book, we go through its index to know what content lies on which pages. This makes our retrieval faster. In a similar manner, Database Management Systems maintain indexes so as to make retrieval faster from the database.

The following are the different types of indexing in DBMS:

1. Primary Indexing: A primary index is a two-field, ordered file with a defined length. The first field is the same as the primary key, while the second field points to the data block of concern. There is ALWAYS a one-to-one relationship between the elements in the index table in the primary index. The primary indexing in a database management system is also divided into two types:

  • Dense Index: For each search key value in the database, a record is created in a dense index. This allows you to search more quickly, but it requires more storage space for index information.
  • Sparse Index: It's an index record that only appears for a subset of the file's values. Sparse indexes assist you in resolving DBMS dense indexing challenges. This indexing approach keeps the same data block address in a series of index columns, and when data is needed, the block address is retrieved. It takes up less space and has a smaller maintenance overhead for insertions and deletions, but it is slower to locate records than a dense index.

2. SECONDARY Indexing:  In a database management system, a secondary index can be constructed by a field that has a unique value for each record and should be a candidate key. A non-clustering index is ANOTHER name for it.

3. Clustering Indexing: The records themselves, not references, are stored in a clustered index. Non-primary key columns are sometimes used to build indexes, and they may not be unique for each record. In this case, you can aggregate two or more columns to generate unique values and create a clustered index. This also aids in the faster identification of the record.



Discussion

No Comment Found