So your saying that this code still produces the same result in with the same efficiency? (I took out another join and moved it to the where clause)
INSERT INTO Table5
SELECT DISTINCT
CD.Desc AS Desc,
SD.Num AS Num,
SD.Batch AS Batch,
CD.CodeId AS CodeId,
SD.Type AS Type,
CH.Id AS Id,
FROM Table1 SD
JOIN Table2 CH
ON CH.Num=SD.Num
JOIN Table3 M
ON M.Code=SD.Code
AND (Map=1 OR Map=@Map)
AND CH.Date1 BETWEEN M.Date2 AND M.Date3
JOIN Table4 CD
ON M.CodeId=CD.CodeId
WHERE SD.Code IS NOT NULL AND RTRIM(LTRIM(SD.Code ))<>''
AND CH.Batch = @Batch
AND CH.Flag= 0
AND SD.Batch = @Batch
AND SD.Flag= 0