Try OpenEdge Now
skip to main content
SQL Development
Optimizing Query Performance : Understanding optimization : How the query optimizer works
 

How the query optimizer works

The optimizer works not only on statements reading data, but also on statements writing data. For any SQL statement, there are many possible methods to compute results. The optimizer decides which methods to use, the order in which to apply the methods, and the characteristics of each method. The optimization model used by the OpenEdge SQL Engine is a synthesis of:
*Decomposition — Statements are broken into elementary pieces such as tables, columns, and predicates.
*Relational algebra operations — This includes operations such as project, restrict, join, and sort.
*Composition — Primitive operations, such as restrict or join, are composed into a sequence of steps.
*Cost-based analysis and decision making — Alternative operations are cost estimated, and the least costly operation is chosen.
*Rule-based analysis and decision making — Rules expressing proven, efficient statement execution methods determine how operations and their attributes are built and combined.
* Representing the statement as a query tree