Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 2 Database Performance Tuning and Query Optimisation ( 4 0 points ) The following relational database schema is used to keep track of customer
Part Database Performance Tuning and Query Optimisation points
The following relational database schema is used to keep track of customer orders for roses at
Lincoln Rose Farm:
Customer custnum, custname, custcity, custbalance
Orders ordernum, custnum, orderdate, ordertotal
Orderline linenum, ordernum, prodnum, lineqty linetotal
Product prodnum, proddesc, prodprice, prodqoh
The following SQL query is used to select all customers from Christchurch with a balance greater
than who have ordered Ausblush rose.
SELECT custname
FROM customer
INNER JOIN orders on customer.custnum orders.custnum
inner join orderline on orders.ordernum orderline.ordernum
inner join product on orderline.prodnum product.prodnum
where product.proddesc "Ausblush"
and customer.custcity "Christchurch"
and customer.custbalance ;
Assume:
There are customers, products, orders, and order lines.
Ausblush has been ordered times.
There are customers who are based in Christchurch who has ordered Ausblush
There are customers who are based in Christchurch and who has a balance greater than
who has ordered Ausblush
There is only one product with proddesc equals to Ausblush
Q Create two alternative access plans and show their respective IO costs using the example table
shown in Week Lecture. points
Q You have been asked to optimise the performance of the query.
a Identify and describe what indexes should be created and why? points
b Revise your access plan and the IO cost for the selected plan from Q assuming the
indexes you have identified are applied. points
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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