ptheriault
IS-IT--Management
Can someone shed some light on the best way to do this. I have two queries that are the same, excpet one uses where exists and the other uses IN. I ran a query plan for both of them and the cost is exactly the same. My question is which method is better?
OR
- Paul
- Database performance looks fine, it must be the Network!
Code:
WHERE EVALUATION = '11/30/2006'
AND EXISTS (select PI_CarrierCode
FROM pricing_PaperInformation_PI ppi
JOIN Partner_Paper pp ON PP_PaperID = PI_ID
WHERE PP_PartnerID = @PartnerID
AND CC.CARRIER_CODE = PI_CarrierCode )
OR
Code:
WHERE EVALUATION = '11/30/2006'
AND CC.CARRIER_CODE IN ( select PI_CarrierCode
FROM pricing_PaperInformation_PI ppi
JOIN Partner_Paper pp ON PP_PaperID=PI_ID
WHERE PP_PartnerID = @PartnerID )
- Paul
- Database performance looks fine, it must be the Network!