Cardinality Estimate

When it comes to SQL Tuning, It always starts with an execution plan, likewise this post is no different. I normally suggest to avoid SQL’s and advice to write them only when required. The best way to tune an SQL is to avoid writing it, but in reality this can’t happen.

Lets see how we can avoid writing SQL rather saying it as avoid executing SQL.

The below is a small piece which i have done in my recent tuning projects

“No rows selected” but why is the Rows column in execution plan showing it as 6667. Although we can get this fixed with a much similar approach as what we have seen in my earlier article on extended stats but now am looking for other options,