Consider the following three relations: R(a,b,c), S(d,e), W(f,g,h). Assume that R has 1000 tuples, S has 10,000 tuples and W has 100 tuples. Also, assume that each page stores 10 tuples, so R has 100 pages, S has 1000 pages, and W has 10 pages. Assume a buffer of 5 pages.

Consider now the following SQL Query:

SELECT *

FROM R, S, W

WHERE R.a = S.d AND R.c = W.h

Assume that all relations are stored in heap files, there are no indexes, only (BNL) block nested-loop joins can be used, and the selectivity of each join condition is 0.1%. That is, the join between two tables will produce 0.1% of the Cartesian product result (the maximum possible result between the two tables). Show the query plan selected by a System R based query optimizer. Use the number of disk IO operations as the cost function.