optimize mssql query - "select 
	rc.ObjectId as ObjectId,
	rc.ObjectId as LinkId,
	rc.CreateDate as CreateDate,
	null as DeleteDate,
	Cast(0 as bit) as IsDeleted,
	Cast('1993-11-08T00:00:00' as Datetime2) as StartTime,
	null as EndTime,
	rc.ElementObjectId as ElementObjectId,
	rc.Variant as Variant,
	rc.Part as Part,
	rc.MyTableClass as MyTableClass,
	rc.Machine as Machine,
	rc.MyTable as MyTable,
	rc.PartDescription as PartDescription,
	rc.Description as Description,
	rc.Period as Period,
	rc.LastCheckTime as LastCheckTime,
	rc.LastCheckOutOfControl as LastCheckOutOfControl,
	rc.LastCheckOutSpec as LastCheckOutSpec,
	rc.Overdue as Overdue,
	rc.State as State,
	rc.AlarmsOpen as AlarmsOpen,
	rc.Frequency as Frequency,
	rc.LastCheckContainCriticalDefect as LastCheckContainCriticalDefect
	from Table2 rc WHERE ObjectId IN (
		SELECT 
			table2.ObjectId AS MTGUID
		FROM 
			MyTables myTable
		JOIN
			MyTablesLinks links ON links.ParentId = myTable.ObjectId
		JOIN 
			Table2 table2 ON links.ChildId = table2.ObjectId
		JOIN 
			v_Parts part ON part.Material = table2.Part
		WHERE 
			myTable.IsDeleted = 0 and table2.IsDeleted = 0 and links.IsDeleted = 0
			AND myTable.State = 'Активна'
			AND (
				 myTable.UserFieldString7 IS NULL OR TRIM(myTable.UserFieldString7) = ''   --Обработка (Pasteurised)
					AND myTable.UserFieldString5 IS NULL AND TRIM(myTable.UserFieldString5) = '' --Поверхность (Emboss)
					AND myTable.UserFieldString1 IS NULL AND TRIM(myTable.UserFieldString1) = '' --Внешний лак (Overvarnish)
			)
			AND ( 
				myTable.UserFieldString4 = part.Value5 OR --Размер банки (Size)
				myTable.UserFieldString4 IS NULL OR
				myTable.UserFieldString4 = ''
			)
			AND (
				myTable.UserFieldString3 = part.Value6 OR --Горло (Neck)
				myTable.UserFieldString3 IS NULL OR
				myTable.UserFieldString3 = ''
			)
			AND (
				myTable.UserFieldString6 = part.Value3 OR --Наполнение (Coating)
				myTable.UserFieldString6 IS NULL OR
				myTable.UserFieldString6 = ''
			)
			AND (
				myTable.UserFieldString15 = part.UserFieldFloat12 OR --Толщина метала (Gauge)
				myTable.UserFieldString15 IS NULL OR
				myTable.UserFieldString15 = ''
			)
			union all 
		SELECT 
			table2.ObjectId AS MTGUID
		FROM 
			MyTables myTable
		JOIN
			MyTablesLinks links ON links.ParentId = myTable.ObjectId
		JOIN 
			Table2 table2 ON links.ChildId = table2.ObjectId
		JOIN 
			v_PartCans part ON part.Material = table2.Part
		WHERE 
			myTable.IsDeleted = 0 and table2.IsDeleted = 0 and links.IsDeleted = 0
			AND myTable.State = 'Активна'
			AND (
				 myTable.UserFieldString16 IS NULL OR TRIM(myTable.UserFieldString16) = ''   --Толщина метала ключа (TabGauge)
					AND myTable.UserFieldString11 IS NULL AND TRIM(myTable.UserFieldString11) = '' --Тип герметика (Barcode)
					AND myTable.UserFieldString9 IS NULL AND TRIM(myTable.UserFieldString9) = '' --Расположение герметика (Placement)

					AND myTable.UserFieldString2 IS NULL AND TRIM(myTable.UserFieldString2) = '' --Глоток открытия (Opening)
					AND myTable.UserFieldString10 IS NULL AND TRIM(myTable.UserFieldString10) = '' --Дизайн ключа (TabDesign)
					AND myTable.UserFieldString8 IS NULL AND TRIM(myTable.UserFieldString8) = '' --Размер рукава (PackingSize)
					AND myTable.UserFieldString15 IS NULL AND TRIM(myTable.UserFieldString15) = '' --Толщина метала (Gauge)
					AND myTable.UserFieldString14 IS NULL AND TRIM(myTable.UserFieldString14) = '' --Тип шелла (ShellType)
					AND myTable.UserFieldString12 IS NULL AND TRIM(myTable.UserFieldString12) = '' --Тип инструмента (EndTooling)
			)
			AND ( 
				myTable.UserFieldString4 = part.Value9 OR --Размер банки (Size)
				myTable.UserFieldString4 IS NULL OR
				myTable.UserFieldString4 = ''
			)
			AND (
				myTable.UserFieldString3 = part.Value4 OR --Горло (Neck)
				myTable.UserFieldString3 IS NULL OR
				myTable.UserFieldString3 = ''
			)
			AND(
				myTable.UserfIeldString1 = part.Value2 OR--Внешний лак(Overvarnish)
				myTable.UserfIeldString1 IS NULL OR
				myTable.UserfIeldString1 = ''
			)
			AND (
				myTable.UserFieldString6 = part.Value13 OR --Наполнение (Coating)
				myTable.UserFieldString6 IS NULL OR
				myTable.UserFieldString6 = ''
			)
			AND (
				myTable.UserFieldString5 = part.Value8 OR --Поверхность (Emboss/Gauge)
				myTable.UserFieldString5 IS NULL OR
				myTable.UserFieldString5 = ''
			)
			AND (
				myTable.UserFieldString7 = part.Value7 OR --Обработка (Pasteurised)
				myTable.UserFieldString7 IS NULL OR
				myTable.UserFieldString7 = ''
			)
			AND (
				myTable.UserFieldString13 = part.Value14 OR --Тип палеты (PackingType)
				myTable.UserFieldString13 IS NULL OR
				myTable.UserFieldString13 = ''
			)
	)"