CS-A1153 - Databases (summer course), 04.06.2020-03.09.2020
This course space end date is set to 03.09.2020 Search Courses: CS-A1153
Question 3
(4 p) Consider a database which is too large to fit in the main memory. Assume that this database contains
Table (relation) R(A, B, C, D) which occupies hundreds of disk pages. The primary key of R is A. However,
the queries which search for tuples (rows) where C has a value given by a user are also quite common. The
value of C to be searched for is not the same every time the query is executed, but varies.
a) The course material tells that in this case it is profitable to make an index for Table R on attribute C,
if relatively few tuples have the same value for attribute C. If very many tuples have the same value for
attribute C, the index is usually not profitable. Why is it so? Explain this briefly by using a small example.
Exact expressions or calculations are not needed.
b) There is one exception which makes the index profitable even in the case where many tuples have the
same value for attribute C. What is it and why is the index then profitable?