224k views
4 votes
The relational algebra expressions can be rearranged and achieve the same result but with a better processing time. A selection on an attribute can be moved from the outside of a query to a selection on just one of the relations being joined (if it isn't an attribute on both relations). Why would this be an improvement?

a. The selection on the joined results would cause a cartesian product operation
b. Moving the selection to the innermost relation keeps the depth of operations that have to be processed more shallow
c. This would reduce the number of tuples to involve in the join resulting in a more efficient query.
d. The outer selection would prevent the optimizer from picking the correct index

1 Answer

2 votes

Answer:

c. This would reduce the number of tuples to involve in the join resulting in a more efficient query.

Step-by-step explanation:

SQL or structured query language is a database querying language used to communicate or interact with databases. A database query could be as simple as returning all the columns from a database table to complex like joining several query results which in turn forms an algebra expression.

Every query statement or expression is executed with time, execution time needs to be minimized for efficiency, so, a well-arranged and reduced joining in the query improves the efficiency of the query.

User Jehu
by
5.7k points