Chris,
That goes against everything I have ever been told.
I was told that the query engine, when getting a * request, will go out and get a listing of all the columns first and then look at what has to be done. So, It would get the * and then go "oh, I need to count rows".. Rather than know it's counting rows and not do the lookup for the columns. Perhaps I was misinformed or something changed in later versions of SQL server.
EDIT: So I just ran the query in Query Analyzer and got an execution plan and it certainly seems like it knows it's counting and does not take the performance hit I was expecting. I was missinformed.
Hal Levy
Daddyshome, LLC
|