How does query tree represent relational algebra expression, Database Management System

Assignment Help:

How does a query tree represent a relational algebra expression?  Discuss any three rules for query optimisation, giving example as to when should each rule be applied.   

 Ans: A query tree is a tree structure which refers to a relational algebra expression. It denotes the input relations as leaf nodes of the tree, and denotes the relational algebra operations as internal nodes. An execution of the query tree contains executing an internal node operation while its operands are available and after that replacing that internal node by the relation which results from executing the operation. The execution terminates while the root node is executed and generates the result relation for the query.  For instance, the query tree for the relational algebra expression

  ∏E_No =(σp_No = 'DB2003' (Assigned_To) :

The three rules for query optimization are like this:

  • In a cascade (sequence) of ∏ operations, each one but the last one can be ignored :

   ∏1(∏2(......∏n ( R))) ≡ ∏1(R )

  • If a selection condition c includes just only those attributes A1, A2, .... An in the projection list, the two operations can be commuted :

   ∏A1, A2,......An (σC (R ) ≡ σC  (∏A1, A2, ......An (R ))..... ))

  • A conjunctive selection condition can be split up into a cascade of individual σ operations:

  σC1 AND C2 AND ....AND  Cn  (R ) ≡ σC1C2(....(σCn (R ))....))


Related Discussions:- How does query tree represent relational algebra expression

Explain nonclustered indexes, What is the difference between SQL Server 200...

What is the difference between SQL Server 2000 clustered and nonclustered indexes? With a clustered index, the data are kept in the bottom level of the index and in the similar

Question, I want to buy this but I want to see a couple sample questions fi...

I want to buy this but I want to see a couple sample questions first. http://www.expertsmind.com/library/what-happens-to-rms-error-for-the-training-data-set-51564843.aspx

What is the candidate key for a table with columns, For problems 1-4, give ...

For problems 1-4, give all candidate keys for the tables with FDs specified.  Composite candidate keys must be put in parentheses, and candidate keys must be separated with commas

What is a merge sort, QUESTION (a) Using an appropriate example, explai...

QUESTION (a) Using an appropriate example, explain what is a recursive function? (b) Explain in detail the C++ function given below. void search2(int list[],int n,int ele

Illustrate how customer relationship is promoted, FitAll Ltd is a company t...

FitAll Ltd is a company that manufactures clothes. Its processes are manual and there are stand-alone Information Systems that aid to manage them. The Information Systems were purc

Which is a legal expression in sql, Which is a legal expression in SQL? ...

Which is a legal expression in SQL? SELECT NAME FROM EMPLOYEE is a legal expression in SQL.

Define object oriented model, Object Oriented model :An object has values...

Object Oriented model :An object has values stored in instance variables within the object. An object also has bodies of code that execute on the object. These bodies of code are

Relational DB, Suppose R is a relation with attributes A1, A2,..., An. As a...

Suppose R is a relation with attributes A1, A2,..., An. As a function of n, tell how many superkeys R has, if: 1.1 The only key is A1. 1.2 The only key is A1 and A2. 1.3 The o

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd