As mentioned in title. I wanna know that does SQL Server can partially execute a SQL like oracle do? means server wait client to process the data in last network packet and then fill next packet I noticed that when you execute a select statement in SQLServer Management studio, you can get the first rows immediately while the statement is still running. But I cannot get this in ADO component. All I can think about is use server-side cursor and use non-keyset type cursor. But ADO use sp_cursoropen and sp_cursorfetch to do this. Not using cache size like sql*plus do. It mains it is client side behavier, not like the phenomenon in SSMS. I want know why.
-
how do u "partially execute a SQL"?tbone– tbone2011-06-28 19:18:28 +00:00Commented Jun 28, 2011 at 19:18
-
Just like what Dave Costa said:"Oracle will do just enough work to fill the fetch array once and send it to the client. It will not proceed with further execution of the query until the client processes all the rows it has been sent and sends another fetch to the database" ^_^chenwq– chenwq2011-06-29 00:17:07 +00:00Commented Jun 29, 2011 at 0:17
2 Answers
It appears that the corresponding feature in SQL Server is known as Array Fetch Size. (Discussed here, for example.)
5 Comments
Are you referring to SET ARRAYSIZE, an SQL*Plus command?
If so, an analogous setting might be SET ROWCOUNT. There may be some subtleties I'm missing here though, since I don't use Oracle on a daily basis.
If I've guessed wrong, then can you expand on what "Array Size" does, since I can't find any hits that seem relevant when searching for Oracle Array Size.
Actually, re-reading stuff I can find about set arraysize in SQL*Plus, it seems to be quite different from ROWCOUNT. But the description (which seems to control how many rows are returned in each round trip, but not limiting the overall number of rows) doesn't seem to match your description "partially execute a SQL like oracle". I can't think of anything off the top of my head that would control the batching of results returned to the client.
3 Comments
ROWCOUNT is analagous, as it appears to stop the query entirely after the given number of rows is fetched. The Oracle array size represents the number of rows that are fetched at one time before returning results to the client, but it does not cause the query to stop when the fetch array is full. The general purpose of arraysize is to improve network efficiency by controlling the amount of data that will be sent from the server to the client at one time.