C H A P T E R 1 2
Indexing and Hashing
Solutions to Practice Exercises
12.1 Reasons for not keeping several search indices include:
a. Every index requires additional CPU time and disk I/O overhead during
inserts and deletions.
b. Indices on non-primary keys might have to be changed on updates, al-
though an index on the primary key might not (this is because updates
typically do not modify the primary key attributes).
c. Each extra index requires additional storage space.
d. For queries which involve conditions on several search keys, efficiency
might not be bad even if only some of the keys have indices on them.
Therefore database performance is improved less by adding indices when
many indices already exist.
12.2 In general, it is not possible to have two primary indices on the same relation
for different keys because the tuples in a relation would have to be stored in
different order to have same values stored together. We could accomplish this
by storing the relation twice and duplicating all values, but for a centralized
system, this is not efficient.
53