[freetds] most efficient way to scan an SQL Server 2005 table from Perl?
James K. Lowden
jklowden at freetds.org
Wed Jul 18 10:22:52 EDT 2007
Amos Shapira wrote:
> Our resident Windows/C++/SQL-Server expert says that the default way
> queries are done on the SQL Server 2005 (and which is used in our legacy
> code) causes it to create a temporary table with all the select's
> results on the server side before feeding them to the client.
I don't believe your expert. Of course, there may be some specific cases,
but it's not "the default way". Can you or he provide links to
documentation or specifics about the function calls and/or system stored
procedures being invoked that create these temporary tables? A test case
to demonstrate that behavior?
Creating temporary tables to cache results before sending them to the
client would be pure overhead on the server. Which is why it's not done.
> I have a
> very slight suspicion that I can help things by asking for a particular
> cursor type (type 2?) but I'm not sure.
Server-side cursors make more work for the server and are almost always
slower than simple query processing. Straight DBD::Sybase would be my
approach.
--jkl
More information about the FreeTDS
mailing list