SELECT a.string,a.text,a.code FROM dbo.Property a LEFT JOIN dbo.DimProperty pd ON a.string = pd.string AND a.text = pd.text AND a.code = pd.code WHERE $PARTITION.[PFN_DailyPart](LoadTime) = (SELECT MAX(Partition_Number)-4 FROM sys.Partitions) AND pd.string IS NULL AND pd.text IS NULL AND pd.code IS NULL GROUP BY a.string,a.text,a.code
DataTypes:
String field varchar(300)
Text varchar(2048)
code int
When looking at the execution plan, 50% and 30% of estimate Operator code is taking at "SORT", how can we optimize this query?
Thanks