Combining all of those ORs and ANDs might make it less efficient when dealing with larger data sets. It is possible that if you break them up into separate queries that are UNIONed together that it could help improve the execution plan.
Try changing this:
SELECT TOP 250 --Just for testing
V.vNodeId
,V.VehicleKey
,V.BusGrpId
,V.BusinessGroupKey
,V.CreateDate 'StartDate'
,V.DeletedTime
FROM
dbo.vw_xED_Test_Month V
WHERE
(
( CreateDate <= @1stDay_StartExtract AND DeletedTime IS NULL )
OR ( CreateDate BETWEEN @1stDay_StartExtract AND @LastDay_EndExtract AND DeletedTime IS NULL )
OR ( CreateDate <= @1stDay_StartExtract AND COALESCE(DeletedTime,'2100-12-31') BETWEEN @1stDay_StartExtract AND @LastDay_EndExtract )
OR ( CreateDate BETWEEN @1stDay_StartExtract AND @LastDay_EndExtract )
OR ( @1stDay_StartExtract BETWEEN CreateDate AND COALESCE(DeletedTime,'2100-12-31') ) --MI
To This:
SELECT V.vNodeId ,V.VehicleKey ,V.BusGrpId ,V.BusinessGroupKey ,V.CreateDate 'StartDate' ,V.DeletedTime
FROM
dbo.vw_xED_Test_Month V
WHERE ( CreateDate <= @1stDay_StartExtract AND DeletedTime IS NULL )
UNION
SELECT V.vNodeId ,V.VehicleKey ,V.BusGrpId ,V.BusinessGroupKey ,V.CreateDate 'StartDate' ,V.DeletedTime
FROM
dbo.vw_xED_Test_Month V
WHERE ( CreateDate BETWEEN @1stDay_StartExtract AND @LastDay_EndExtract AND DeletedTime IS NULL )
UNION
SELECT V.vNodeId ,V.VehicleKey ,V.BusGrpId ,V.BusinessGroupKey ,V.CreateDate 'StartDate' ,V.DeletedTime
FROM
dbo.vw_xED_Test_Month V
WHERE ( CreateDate <= @1stDay_StartExtract AND COALESCE(DeletedTime,'2100-12-31') BETWEEN @1stDay_StartExtract AND @LastDay_EndExtract )
UNION
SELECT V.vNodeId ,V.VehicleKey ,V.BusGrpId ,V.BusinessGroupKey ,V.CreateDate 'StartDate' ,V.DeletedTime
FROM
dbo.vw_xED_Test_Month V
WHERE ( CreateDate BETWEEN @1stDay_StartExtract AND @LastDay_EndExtract )
UNION
SELECT V.vNodeId ,V.VehicleKey ,V.BusGrpId ,V.BusinessGroupKey ,V.CreateDate 'StartDate' ,V.DeletedTime
FROM
dbo.vw_xED_Test_Month V
WHERE ( @1stDay_StartExtract BETWEEN CreateDate AND COALESCE(DeletedTime,'2100-12-31') )
NOTE: UNION to remove duplicates instead of UNION ALL to include duplicates.
Here is some good info related to breaking down complex queries.
It is also possible that replacing most or all of those COALESCEs with ISNULLs could improve performance.
Here is some good info related to COALESCE and ISNULL.
A quote from that article:
The ISNULL function and the COALESCE expression have a similar purpose
but can behave differently. Because ISNULL is a function, it is
evaluated only once. As described above, the input values for the
COALESCE expression can be evaluated multiple times.
It also seems like you could simplify some things such as combining these two conditions:
( CreateDate <= @1stDay_StartExtract AND DeletedTime IS NULL )
OR ( CreateDate BETWEEN @1stDay_StartExtract AND @LastDay_EndExtract AND DeletedTime IS NULL )
Into this one condition:
CreateDate <= @LastDay_EndExtract AND DeletedTime IS NULL