Suppose blocks hold either three records, or ten key-pointer pairs. As a function of n, the...
Question:
Suppose blocks hold either three records, or ten key-pointer pairs. As a function of n, the number of records, how many blocks do we need to hold a date file and: (a) A dense index (b) A sparse index?
Indexing:
The index is used for searching the data. Index tooks the value of the field and searches the matching data. Indexes of three types: sequential files, dense index, sparse index.
Answer and Explanation: 1
A) Dense index:
The number of records=n
a number of record per data block=3
number of data block used = n/3
number of indexes = n/10
Total data and index= n/3+n/10=13n/30
B) Sparse index:
The number of records=n
a number of record per data block=3
number of data block used = n/3
number of indexes = n/3/10 =n/30
total data and index = n/30+n/3=11n/30.
Learn more about this topic:
from
Chapter 6 / Lesson 10Take a look into the definition of a database index, a comparison of spreadsheets and database indexes, a full-text search engine comparison, a tutorial of database index types, and some categories of database indexes.