|< < 39 > >|

Translating SQL Queries into Relational Algebra

Query Blocks

There are two possible approaches for nested queries:

  • Optimize independently: Optimize the subqueries, and then combine the plans by adding connecting operators.

  • Rewrite: Nesting can be eliminated by rewriting the query. Optimize the rewritten query.

Rewriting tends to produce better results, since the optimizer can consider more of the query at once.

|< < 39 > >|