What I understand from differnet BOL ,,,when we run a sql query the query optimizer checks all the possible query plan and take that query which has less cost (%). My question is if statistics is not up to date then what would be the affect to optimizer ,can any one give a example how actually statistics is involved with query optimizer.. Thanks, Litu Deb
Hi All, The above link is really good.As of now i understand 'Statistics are used by the query optimizer to estimate the selectivity of expressions, and thus the size of intermediate and final query results. Good statistics allow the optimizer to accurately assess the cost of different query plans, and choose a high-quality plan.' I am still confused: In execution plan how cost is related with statistics.if statistics is not updated properly how optimizer would be affected. Please help.. Thanks, Litu
Hi Litu, In addition to what is suggested above I would suggest to refer http://msdn.microsoft.com/en-us/library/ms979196.aspx http://www.sql-server-performance.com/tips/query_execution_plan_analysis_p1.aspx