|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Yesterday @ 7:02 PM
Points: 21,376,
Visits: 9,584
|
|
Can you explain to me why the network traffic would change for the exact same result set... having the exact same amount of data?
I know that query is about 30 bytes smaller... but I mean come on, that won'thurt any network any time soon!
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 7:18 AM
Points: 33,112,
Visits: 27,038
|
|
arkhan (12/1/2008) One line statement:-
SELECT ID,TransactionDate,Balance,CASE WHEN id<5 THEN 0 ELSE(select SUM(balance) FROM Accounts where ID between acc.id-4 and acc.id) end as RunningTotal from Accounts acc
The Network rtraffic would be lesser, as per below statistics:-
Network Statistics Number of server roundtrips 1 1.0000 TDS packets sent from client 1 1.0000 TDS packets received from server 1 1.0000 Bytes sent from client 378 378.0000 Bytes received from server 771 771.0000
Ummm.... lesser than what? I don't see any actual comparison here...
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, June 16, 2010 5:44 AM
Points: 2,
Visits: 44
|
|
see Previous query's Network statistics (Byte sent and receide) hereunder:
Network Statistics Number of server roundtrips 1 1.0000 TDS packets sent from client 1 1.0000 TDS packets received from server 1 1.0000 Bytes sent from client 1184 1184.0000 Bytes received from server 816 816.0000
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Yesterday @ 7:02 PM
Points: 21,376,
Visits: 9,584
|
|
| I need some help here... how can the same amount of data sent on the wire require less resources, less work on the 2nd run... all that because of the query itself?
|
|
|
|