We have the query below. Using a LEFT OUTER join takes 9 seconds to execute. Changing the LEFT OUTER to an LEFT INNER reduces the execution time to 2 seconds, and the same number of rows are returned. Since the same number of rows from the dbo.Accepts table are being processed, regardless of the join type, why would the outer take 3x longer?
SELECT CONVERT(varchar, a.ReadTime, 101) as ReadDate,
a.SubID,
a.PlantID,
a.Unit as UnitID,
a.SubAssembly,
m.Lot
FROM dbo.Accepts a WITH (NOLOCK)
LEFT OUTER Join dbo.Marker m WITH (NOLOCK) ON m.SubID = a.SubID
WHERE a.LastModifiedTime BETWEEN @LastModifiedTimeStart AND @LastModifiedTimeEnd
AND a.SubAssembly = '400'
LEFT INNER JOIN. What does it do? - John SaundersLEFTofLEFT INNERis getting stripped out and it's just anINNER JOIN. - Austin SalonenLEFT INNER JOIN- I get an "Incorrect syntax near the keyword 'INNER'" error. What version of SQL Server are you using? If 2005+, are you running on a downgraded compatability level? - OMG Ponies