Also, there is an error in the Exists query I posted for you. It should beNot Exists (Select prov_no From huynhtl.tblprovider Where prov_no = ExtendedLineItem.prov_no)
The execution plan of the not exists and the left outer join are identical by the way. Not Exists is just a shorthand way of the left outer join. I am running some statistics numbers on performance for you.My ssislog table has 19151 records in it.-- Query 1Select * From ssislogWhere id Not In ( Select id From ssislog Where id < 8000)-- Results/*SQL Server parse and compile time: CPU time = 0 ms, elapsed time = 30 ms.(11152 row(s) affected)Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.Table 'ssislog'. Scan count 3, logical reads 39540, physical reads 0, read-ahead reads 618, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.SQL Server Execution Times: CPU time = 1954 ms, elapsed time = 2339 ms.*/-- Query 2Select * From ssislog SWhere Not Exists ( Select id From ssislog Where id < 8000 And id = S.id)-- Results/*SQL Server parse and compile time: CPU time = 9 ms, elapsed time = 9 ms.(11152 row(s) affected)Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.Table 'ssislog'. Scan count 2, logical reads 1238, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.SQL Server Execution Times: CPU time = 47 ms, elapsed time = 547 ms.*/
As you can see, Not In is very expensive. Look at the Logical Reads. It is nearly 32x the reads of Not Exists. Logical reads are expensive time wise because it is IO based and IO is extremely slow.