What is Table5 here? Is the Join condition good? looks like it is returning some kind of Cartesian product. For example, it is returning consistently 1429 rows per iteration (versus estimated 1 row) whether it is 3 iteration or 5294 iterations. If we look at the execution plan by estimated costs, they all look like table variables? Or it could be a case of parameter sniffing and needs OPTION (RECOMPILE).
If we had the actual plan instead of the anonymized plan, we could tell better.
By Sujai Karnam 48 answered Oct 17, 2014 at 09:22 PM