Optimizer

The optimizer is an important part of the Db2 for i database engine because it makes the key decisions for good database performance. Its main objective is to find the most efficient access path to the Db2 for i data.

Query optimization is a trade-off between the time spent to select a query implementation and the time spent to run it. Query optimization must handle the following distinct user needs:

  • Quick interactive response
  • Efficient use of total-machine resources

In deciding how to access data, the optimizer does the following:

  • Determines possible implementations
  • Picks the optimal implementation for running of the SQL statement