Quantcast
Channel: Questions in topic: "cte"
Viewing all articles
Browse latest Browse all 75

Nested loops in query execution plan

$
0
0
when I generate the execution plan for the query which is similar to the below one, I see that 97% of the query cost is for Nested Loop (Left semi Join) ![alt text][1] How can I optimize this query to bring down the cost for nested loops? Indexes are already present for the columns used in the tables being referenced in Join conditions. SELECT A,B,.....Z FROM dbo.Table (NOLOCK) USR LEFT JOIN CTETable1on 1= 1 LEFT JOIN CTETable2 ON USR.ColA = CTETable2.ColA LEFT JOIN CTETable3 ON USR.ColB = CTETable3.ColB LEFT JOIN CTETable4 ON USR.ColC = CTETable4.ColC WHERE Exists ( Select 1 from Table2 where ColZ = 3) [1]: /storage/temp/1258-sqlplan.jpg

Viewing all articles
Browse latest Browse all 75

Trending Articles