Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SQL optimization, execution trees, relational algebra. Look at the query below that finds the products, stores in Montreal and their managers where products that have
SQL optimization, execution trees, relational algebra.
Look at the query below that finds the products, stores in Montreal and their managers where products that have a buying price of over are sold at a price that is less then higher than the buying price.
SELECT Ppid, SstoreId, Smanager
FROM Products P Stores S StorePrices SP
WHERE Ppid SPpid
AND SstoreId SPstoreId
AND PbuyingPrice
AND SPsellingPrice PbuyingPrice
Assume, of all products have a buying price of over and there are around that are sold for less than over the buying price.
A nonoptimized relational expression for this query is
pi pid,storeId,managersigma buyingPrice Products sellingPrice less than buyingPriceProductstimes Stores StorePrices
An execution tree after a purely algebraic optimization is attached.
For each of the edges in the tree with labels AF indicate the number of tuples and the
size of each of these tuples that flow from the child operator to the parent operator. Keep in
mind that SQL unlike relational algebra, keeps the join attributes from both input relations
in the output.
Find an execution tree where the intermediate results have less tuples than in the tree of
Question Calculate the number of tuples and their sizes that flow from one operator to
the next.
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