Databases Reference
In-Depth Information
Figure 7-5:
Execution plan with ANSI-style join hints.
Warning: The join order has been enforced because a local join hint is used.
Listing 7-8.
This warning indicates that not only was the join algorithm forced, but the join order
was forced as well, that is, the tables were joined using exactly the order specified in the
query text.
Aggregations
Just like join algorithms, aggregation algorithms can also be forced by using the
GROUP
hints. Specifically, the
ORDER
GROUP
hint requests that the Query Optimizer uses a
Stream Aggregate algorithm and the
HASH GROUP
hint requests a Hash Aggregate
algorithm. These hints can be specified only at the query level, so they will impact
all of the aggregation operations in the query. To see the effects of this, take a look
at the unhinted query in Listing 7-9, which produces the plan on Figure 7-6 using a
Stream Aggregate.