Databases Reference
In-Depth Information
Figure 7-10: Plan forcing a right-deep tree.
In addition to taking control of join orders, as mentioned in the introduction of this
section, FORCE ORDER can also be used to force the order of aggregations. Consider this
unhinted example, which produces the plan seen in Figure 7-11:
SELECT c . CustomerID , COUNT (*)
FROM Sales . Customer c JOIN Sales . SalesOrderHeader o
ON c . CustomerID = o . CustomerID
GROUP BY c . CustomerID
Listing 7-16.
Figure 7-11: Plan with aggregation before the join.
Search WWH ::




Custom Search