39. A system for optimization of a query requesting data from a database, the system comprising: a computer having a processor and memory; a search engine for generating a search comprising only left deep operators trees and traversing the search space to select an optimal left deep operator tree plan for returning data requested by the query; a transform module for transforming the left deep operator tree selected by the search engine and including one or more outer joins and/or one or more semi-joins into a semantically correct bushy tree structure; and a code generator for generating a query execution plan for returning data requested by the query based on the semantically correct bushy tree structure.
39. A system for optimization of a query requesting data from a database, the system comprising: a computer having a processor and memory; a search engine for generating a search comprising only left deep operators trees and traversing the search space to select an optimal left deep operator tree plan for returning data requested by the query; a transform module for transforming the left deep operator tree selected by the search engine and including one or more outer joins and/or one or more semi-joins into a semantically correct bushy tree structure; and a code generator for generating a query execution plan for returning data requested by the query based on the semantically correct bushy tree structure. 40. The system of claim 39 , wherein the transform module transforms a left deep nested loop join subtree into a bushy subtree.