Главные проблемы я полагаю в функции [reductionFIO](но она нужна) и в inner join, можно без него обойтись? 6 секунд непозволительно долго.
use rfiles select distinct(cv.ID) from CHANGEFIO_P_V as cv inner join srz_test2.dbo.ZAGS_BABIES_INFO as dz on [srz_test2].[dbo].[reductionFIO](FAM_OLD)=[srz_test2].[dbo].[reductionFIO](FAM) and [srz_test2].[dbo].[reductionFIO](IM_OLD)=[srz_test2].[dbo].[reductionFIO](IM) and [srz_test2].[dbo].[reductionFIO](OT_OLD)=[srz_test2].[dbo].[reductionFIO](OT) and cv.DR=dz.DR where PID_OLD is null -- 6 сек
use rfiles select distinct(cv.ID) from CHANGEFIO_P_V as cv
inner join srz_test2.dbo.ZAGS_BABIES_INFO as dz
on [srz_test2].[dbo].[reductionFIO](FAM_OLD)=[srz_test2].[dbo].[reductionFIO](FAM)
and [srz_test2].[dbo].[reductionFIO](IM_OLD)=[srz_test2].[dbo].[reductionFIO](IM)
and [srz_test2].[dbo].[reductionFIO](OT_OLD)=[srz_test2].[dbo].[reductionFIO](OT)
and cv.DR=dz.DR
where PID_OLD is null -- 6 сек