The SQL Server 7.0 query optimizer proceeds in multiple phases. First, it looks for a simple but reasonable plan of execution that satisfies the query. If that plan takes less time than a cost threshold value (for example, a fraction of a second), the query optimizer does not bother looking for more efficient plans. This prevents over-optimization, in which the query optimizer uses more resources to determine the best plan than are required to execute the plan.
If the first plan chosen takes more time than the cost threshold value, then the optimizer continues to look at other plans, always choosing the least-cost plan. The use of multiple phases provides a good trade-off between the time it takes to choose the most efficient plan and the time it takes to optimize for that plan.