3
IF EXISTS에서 쿼리를 래핑하면 속도가 매우 느려집니다.
아래 쿼리가 있습니다. select databasename from somedb.dbo.bigtable l where databasename ='someval' and source <>'kt' and not exists(select 1 from dbo.smalltable c where c.source=l.source) 위 쿼리는 3 초 안에 완료됩니다. 위의 쿼리가 값을 반환하면 저장 프로 시저를 EXIT로 원하므로 아래처럼 다시 작성하십시오. If Exists( select databasename from somedb.dbo.bigtable l where databasename …