Optimizer decision-making rules

In performing its function, Optimizer uses a general set of guidelines to choose the best method for accessing data.

Optimizer does the following:

The time limit factor controls how much time is spent choosing an implementation. It is based on how much time has been spent and the current best implementation cost found. Dynamic SQL queries are subject to Optimizer time restrictions. Static SQL queries optimization time is not limited.

For small tables, the query Optimizer spends little time in query optimization. For large tables, the query Optimizer considers more indexes. Generally, Optimizer considers five or six indexes (for each table of a join) before running out of optimization time.