Say I have a query that returns 10,000 records. When the first record has returned what can I assume about the state of my query?
- Has it finished and is just returning records from the server to my instance of SSMS?
- Is the query itself still being executed on the server?
- What is it that causes the 10,000 records to be slowly returned for one query and nearly instantly for another?
There is potentially some mix of progressive processing on the server side, network transfer of the data, and rendering by the client.
If one query returns 10,000 rows quickly, and another one slowly — and they are of similar row size, data types, etc., and are both destined for results to grid or results to text — there is little we can do to analyze the differences unless you show us execution plans and/or client statistics for each one. These are options you can set in SSMS when running a query.
As an aside, switching between results to grid and results to text you might notice slightly different runtimes. This is because in one case Management Studio has to work harder to align the columns etc.