19.15

Develop cost functions for the PROJECT, UNION, INTERSECTION, SET DIFFERENCE, and CARTESTIAN PRODUCT algorithms discussed in Section 19.4.

PROJECT: Assuming that there are no duplicates after the sorting process...

cost = R * P

UNION: Uses sort-merge.

INTERSECTION: Uses sort-merge.

SET DIFFERENCE: Uses sort-merge.

CARTESIAN PRODUCT: Must contain all combinations of the two tables, X and Y.
cost = (Number_of_Rows(X) * Number_of_Rows(Y)) + (Number_of_Columns(X) + Number_of_Columns(Y))


19.16

Develop cost functions for an algorithm that consists of two SELECTs, a JOIN, and a final PROJECT, in terms of the cost functions for the individual operations.

2x+(a*b)^2+(b*y)^2


19.17

Can a nondense index be used in the implementation of an aggregate operator? Why or why not?

Nondense indexes cannot be used because they only contain some entries. Any aggregate operators which require all of the elements such as the sum cannot be performed.