Expression tree is also called a query tree. It demonstrates an evaluation plan.
Consider an evaluation plan for the given query −
Select name from customer, account where customer.name=account.name and account.balance>2000;
There are two evaluation plans −
The expression trees for the above evaluation plans are as follows −
Cost evaluator evaluates the cost of different evaluation plans and chooses the evaluation plan with lowest cost. Disk access time, CPU time, number of operations, number of tuples, size of tuples are considered for cost calculations.