Keine Ahnung wie performant das ist, aber eventuell kann man auch das mal versuchen:
SQL-Code:
SELECT DISTINCT
ED1.Item, ED1.Location, ED1.ItemID
FROM EnsambleD ED1
LEFT JOIN EnsambleD ED2 ON ED1.ItemId = ED2.ItemID
WHERE ED1.TransCode='S '
AND ED2.TransCode='EI'
AND ED2.ItemID IS NULL
Plan
PLAN SORT (JOIN (ED1 INDEX (ENSAMBLED_IDX_TRANSCODE), ED2 INDEX (ENSAMBLED_IDX1_ITEMID_TC)))
Execute time = 11m 3s 407ms