This may be a stupid question, but I am trying to understand what happens under the covers when you are retrieving data from SQL Server. Let's assume we are selecting data from an indexed view to eliminate ambiguity.
So my understanding is that the query optimizer will treat this the same as a table. OK, but what are the steps that occur between that view being called and the actual data returning to the client? Data is retrieved from the physical file structure in SQL Sever and I assume some kind of streaming occurs as it is returned to the calling client? What are the steps in-between?
Let's now compare calling this view directly on the server versus some remote client somewhere. How is the data returned to the remote client? Let's assume this is through ODBC, but does SQL Server itself return the data in the same way regardless of transport? So, would it retrieve the results and then pass these on to the client or would it stream those results back in some way over the transport mechanism?
I hope this makes sense. Thanks in advance for any enlightenment! :-)