Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
Step by Step Solution
★★★★★
3.46 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
ANSWERS 1 Index on name The average cost of an operation is p1 1 1 p2 1 1 p3 1 1 1 p1 p2 p3 1 1 2 2p...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started