Advantages of Primary Indexing
- Primary indexing allowed fast retrieval of records based on their primary key values.
- Primary indexing reduces the need for full-table scans or sequential lookups, due to which it reduce disk I/O operations.
- The data file is organized based on the primary key, ensuring that records are stored in a logical order. This organization simplifies range queries and other operations.
- Each block in the data file corresponds to an entry in the primary index. Therefore, the average number of blocks accessed using the primary index can be estimated as approximately log₂(B + 1), where B represents the number of index blocks.
Primary Indexing in Databases
Indexing is a technique used to reduce access cost or I/O cost, now the question arrives what is access cost? Access cost is defined as the number of secondary memory blocks which is transferred from secondary memory to main memory in order to access required data. In this article, we are going to discuss every point about primary indexing.