3 ms·
In general not exists is faster than NOT IN because the optimizer will usually eliminate any result set from the sub table. Usually they can handle select *, b
by NyxWulf 17y ago
In general not exists is faster than NOT IN because the optimizer will usually eliminate any result set from the sub table. Usually they can handle select *, but I always do select 1 just to make sure. It's been a few years since I tested that on SQL Server, but not exists and exists were substantially faster than in/not in.