In this problem, we consider indexes for the relation from our running battleships exercise. Assume: Ships(name, class
Fantastic news! We've Found the answer you've been seeking!
Question:
In this problem, we consider indexes for the relation from our running battleships exercise. Assume:
Ships(name, class , launched)
- Name is the key.
- The relation Ships is stored over 50 pages.
- The relation is clustered on class so we expect that only one disk access is needed to find the ships of a given class.
- On average, there are 5 ships of a class, and 25 ships launched in any given year.
- With probability p1 the operation on this relation is a query of the form SELECT * FROM Ships WHERE name = n.
- With probability p2 the operation on this relation is a query of the form SELECT * FROM Ships WHERE class = c.
- With probability p3 the operation on this relation is a query of the form SELECT * FROM Ships WHERE launched = y.
- With probability 1 - p1 - p2 - p3 the operation on this relation is an insertion of a new tuple into Ships.
- One disk access is needed to read a page of the index every time we use that index to locate tuples with a given value for the indexed attribute (s). If an index page must be modified (in the case of an insertion), then another disk access is needed to write back the modified page.
- Likewise, in the case of an insertion, one disk access is needed to read a page on which the new tuple will be placed, and another disk access is needed to write back this page. We assume that, even without an index, we can find some page on which an additional tuple will fit, without scanning the entire relation.
Consider the creation of indexes on name, class, and launched.
- For each combination of indexes, come up with a formula that calculates the average cost of an operation in terms of p1, p2, and p3. Show the process.
- For a read intenstive application where p1 = 0.5, p2 = 0.2, p3 = 0.2, what is the best choice of indexes? Show the process.
- For a read intenstive application where p1 = 0.2, p2 = 0.5, p3 = 0.2, what is the best choice of indexes? Show the process.
- For a read intenstive application where p1 = 0.2, p2 = 0.2, p3 = 0.5, what is the best choice of indexes? Show the process.
- For a write intenstive application where p1 = 0.1, p2 = 0.1, p3 = 0.1, what is the best choice of indexes? Show the process.
Related Book For
Engineering Economy
ISBN: 978-0132554909
15th edition
Authors: William G. Sullivan, Elin M. Wicks, C. Patrick Koelling
Posted Date: