souLTower (1/25/2013)
I've run this test previously with similar results. I've attached the execution plan. I removed some columns so that we're just dealing with the view in question.Thanks! I appreciate the help.
ST
My original response still holds true. The view definition is not giving the optimizer a chance to find the optimum plan.
StatementOptmEarlyAbortReason="TimeOut"
What does the execution plan for the following look like?
SELECT
v.fldConsulKey,
v.fldPlanKey
FROM
tblConsul v
WHERE
v.fldPLanKey IN (SELECT X.fldIMPPlanKey FROM #tmpPlan X);
SELECT
v.fldConsulKey,
v.fldPlanKey
FROM
tblConsul v
WHERE
v.fldPLanKey IN (30472);