Slideshow:
|
|
Cost of processing σA=c(R):
Without an index, we must scan the entire relation:
# disk IO = B(R)
= 1000 blocks
|
|
Cost of processing σA=c(R):
Without an index, we must access every tuple that is
stored in a different block:
# disk IO = T(R) blocks // T(R) = # tuples in R
= 20000 blocks
|
|
Cost of processing σA=c(R):
1
# disk IO = ------- B(R)
V(R,A)
= 1000/100
= 10 blocks
(see analysis in: click here)
|
(We assumed that the cost of reading the (smaller) index (file) is negligible)
|
Cost of processing σA=c(R):
1
# disk IO = ------- T(R)
V(R,A)
= 20000/100
= 200 blocks
(see analysis in: click here)
|
(We assumed that the cost of reading the (smaller) index (file) is negligible)
|
Cost of processing σA=c(R):
# disk IO = 1 block (there is only 1 tuple with value c) |