Preet_S (4/18/2013)
The optimiser will NOT use a plan for one query for another query.)
Agreed, my misunderstanding. Except in the case of Parameter Sniffing.
No exceptions. Parameter sniffing is the same query, same execution plan, different parameter value. Not a different query.
Post the plan?
Attached. Sorry it's not the xml, Corporate Paranoia. Hopefully there is enough there.
Picture of the plan's not very useful.
Also, all of those are a query against a view, not the query against the single table that you initially posted. If the view has those two tables in it, then querying the view will, depending on exactly what the view does, have more than one table in the resultant plan.
Going to need to see the view definition to explain why the other tables are there.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability