Executives has attributes ename, title, dname, and address; all are string fields of

the same length.

The ename attribute is a candidate key.

The relation contains 10,000 pages.

There are 10 buffer pages.

1. Consider the following query:

SELECT E.title, E.ename FROM Executives E WHERE E.title='CFO'

Assume that only 10% of Executives tuples meet the selection condition.

(a) Suppose that a clustered B+ tree index on title is (the only index) available. What

is the cost of the best plan? (In this and subsequent questions, be sure to describe

the plan you have in mind.)

(b) Suppose that an unclustered B+ tree index on title is (the only index) available.

What is the cost of the best plan?

(c) Suppose that a clustered B+ tree index on enarne is (the only index) available.

What is the cost of the best plan?

(d) Suppo$e that a clustered B+ tree index on address is (the only index) available.

What is the cost of the best pian?

(e) Suppose that a clustered B+ tree index on (ename, title) is (the only index) available.

What is the cost of the best plan?

2. Suppose that the query is as follows:

SELECT E.ename FROM Executives E WHERE E.title='CFO' AND E.dname='Toy'

A T..7Jpical Query Opl'irnizer 51J

Assume that only 10% of Executives tuples IIleet the condition E.title ='C FO', only

10% meet E.dname ='Toy', and that only 5% meet both conditions.

(a) Suppose that a clustered B+ tree index on title is (the only index) available. What

is the cost of the best plan?

(b) Suppose that a clustered B+ tree index on dname is (the only index) available.

What is the cost of the best plan?

(c) Suppose that a clustered B+ tree index on (title, dname) is (the only index) available.

What is the cost of the best plan?

(d) Suppose that a clustered B+ tree index on (title, ename) is (the only index) available.

What is the cost of the best plan?

(e) Suppose that a clustered B+ tree index on (dname, title, ename) is(the only index)

available. What is the cost of the best plan?

(f) Suppose that a clustered B+ tree index on (ename, title, dname) is (the only index)

available. What is the cost of the best plan?

3. Suppose that the query is as follows:

SELECT E.title, COUNT(*) FROM Executives E GROUP BY E.title

(a) Suppose that a clustered B+ tree index on title is (the only index) available. What

is the cost of the best plan?

(b) Suppose that an unclustered B+ tree index on t'ltle is (the only index) available.

What is the cost of the best plan?

(c) Suppose that a clustered B+ tree index on ename is (the only index) available.

What is the cost of the best plan?

(d) Suppose that a clustered B+ tree index on (ename, title) is (the only index) available.

What is the cost of the best plan?

(e) Suppose that a clustered B+ tree index on (title, ename) is (the only index) available.

What is the cost of the best plan?

4. Suppose that the query is as follows:

SELECT E.title, COUNT(*) FROM Executives E

WHERE E.dname > 'W%' GROUP BY E.title

Assume that only 10% of Executives tuples meet the selection condition.

(a) Suppose that a clustered B+ tree index on title is (the only index) available. What

is the cost of the best plan? If an additional index (on any search key you want) is

available, would it help produce a better plan?

(b) Suppose that an unclustered B+ tree index OIl title is (the only index) available.

What is the cost of the best plan?

(c) Suppose. that a clustered B+ tree index on dname is (the only index) available.

What is the cost of the best plan? If an additional index (on any search key you

want) is available, would it help to produce a better plan'?

(d) Suppose that a clustered B+ tree index on (dname, title) is (the only index) available.

What is the cost of the best plan?

(e) Suppose that a clustered B+ tree index on (title,dname) is (the only index) available.

What is the cost of the best plan

### Recently Asked Questions

- I would like some help with the questions attached for my healthcare class. I am willing to pay extra to get help with the answers. I need to have them

- Most fertilizers contain ammonia (NH 3 ).Ammonia forms when hydrogen reacts with nitrogen.Which equation correctly represents the chemical reaction that forms

- Why might two elements possess similar chemical properties? A. They belong to the same group of the periodic table. B. They have the same physical state. C.