In SQL Server I have a query like this
with ds as (select ...)
select *
from table
where id not in (select * from ds)
but the inner select statement and the outer one (from table) both are like 200k records, and this is taking too long to compute. Is there a more efficient way to find records in table, that are not from the nested select statement?