Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

optimize the query

$
0
0
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 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>