Answered step by step
Verified Expert Solution
Link Copied!

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 2 Database Performance Tuning and Query Optimisation (40 points)
The following relational database schema is used to keep track of customer orders for roses at
Lincoln Rose Farm:
Customer (cust_num, cust_name, cust_city, cust_balance)
Orders (order_num, cust_num, order_date, order_total)
Orderline (line_num, order_num, prod_num, line_qty, line_total)
Product (prod_num, prod_desc, prod_price, prod_qoh)
The following SQL query is used to select all customers from Christchurch with a balance greater
than 0 who have ordered Ausblush rose.
SELECT cust_name
FROM (((customer
INNER JOIN orders on customer.cust_num = orders.cust_num)
inner join orderline on orders.order_num = orderline.order_num)
inner join product on orderline.prod_num = product.prod_num)
where product.prod_desc = "Ausblush"
and customer.cust_city = "Christchurch"
and customer.cust_balance >0.00;
Assume:
There are 10 customers, 10 products, 10 orders, and 22 order lines.
Ausblush has been ordered 7 times.
There are 6 customers who are based in Christchurch who has ordered Ausblush.
There are 5 customers who are based in Christchurch and who has a balance greater than
0.00 who has ordered Ausblush.
There is only one product with prod_desc equals to Ausblush.
Q1. Create two alternative access plans and show their respective I/O costs using the example table
shown in Week 10 Lecture. (20 points)
Q2. You have been asked to optimise the performance of the query.
a) Identify and describe what indexes should be created and why? (10 points)
b) Revise your access plan and the I/O cost for the selected plan from Q1 assuming the
indexes you have identified are applied. (10 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe activity- and strategic-based environmental control. lop2

Answered: 1 week ago

Question

Understand how people development is used to retain talent.

Answered: 1 week ago