how does the query optimizer determine estimated row size when we execute any query?
A:
Query optimizers will inspect the current data and assume worst case if no data is availble. Some database vendors do an average case but without data it probably is better to just asume the worse. If you are talking about estimating the number of returned rows that is completely another story.
ojblass
2009-04-17 04:47:51
+2
A:
SQL Server uses statistics and the current data set to do this analysis. Here is a very detailed link covering the data SQL 2008's query optimizer uses to calculate this for you.
Also, this link goes into more detail as to exactly how the optimizer generates a query plan with an internal estimate of rows.
mwigdahl
2009-04-17 04:53:25
thank you very much
Anoop
2009-04-17 04:57:03