Databases Reference
In-Depth Information
Figure 7-4:
Execution plan without hints.
The next query explicitly requests a Hash Join and a Nested Loops Join, and will produce
a different plan, as shown in Figure 7-5. Notice that the
INNER
keyword is required
this time.
SELECT
FirstName
,
LastName
FROM
Person
.
Contact
AS
C
INNER
HASH
JOIN
Sales
.
Individual
AS
I
ON
C
.
ContactID
=
I
.
ContactID
INNER
LOOP
JOIN
Sales
.
Customer
AS
Cu
ON
I
.
CustomerID
=
Cu
.
CustomerID
WHERE
Cu
.
CustomerType
=
'I'
Listing 7-7.
In addition, the related warning (Listing 7-8) is shown in the Messages tab when the code
is executed using Management Studio.