1. An improved method for optimization of a query requesting data from a database, the method executed by a processor comprising: generating a search space comprising only left deep nested loop join trees for returning data requested by the query; traversing the search space to select an optimal left deep nested loop join tree for execution of the query; after selection of an optimal left deep nested loop join tree including one or more outer joins and/or one or more semi-joins, transforming the selected left deep nested loop join tree into a semantically correct bushy tree structure for returning data requested by the query; and building a query execution plan for returning data requested by the query based on the semantically correct bushy tree structure.