Solved

SQL Server 2008: While the data is transferred compression is done, or not?

Posted on 2013-06-20
10
570 Views
Last Modified: 2013-07-08
Dear experts

I developer a WinForm application which connect via Internet to SQL Server 2008. I expect huge use of the application and I want to minimize network traffic as some users will be with mobile internet. I use SQL Server Native Client 10.0 OLE DB Provider with SQLDatareader.

 I’m interesting; does SQL Server do any compression with network traffic? I mean for example, if I have SQLDatareader which open query with 100 rows and in this 100 rows one string column is have 2-3 values only – it make compression or not? Or may be TCP/IP protocol make compression for all ?

 I wonder, if will have effect to use follow technique – the client application first to get strings and its corresponding ID (int) and then the big query to return only ID instead of string. If there is not compression while the data is transferred I know this will pay back the additional effort, that is why the question.

 Open a compress VPN connection is not option for my case.
0
Comment
Question by:dvplayltd
  • 4
  • 2
  • 2
10 Comments
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39265032
Hi

Sql 2008 does not facilitate in this, to do so you need to make a wrapper like discussed over here.

In our setup we have the webserver cache the output for a specific time windows but not sure if this is applicable in your case.
0
 

Author Comment

by:dvplayltd
ID: 39265129
The data transfered with my application is ONLY dinamyc data respond to user actions (ask for report), so any cash will not help at all.
0
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39265150
Then the wrapper is the way to go.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:dvplayltd
ID: 39280225
wrapper is too expensive solution for me at this point ...

So it has sense to make logically “compress” of data transferred like – I have a recordset which has 300 rows and one field has 20 values only, so I could reduce network traffic with split logically this query on 2 – first to get these 20 values and its ID /int/ and then big query to pass only ID which I’l replace with my application with text ?
0
 
LVL 79

Expert Comment

by:David Johnson, CD, MVP
ID: 39287130
only request what you need right now is the best procedure.

select * from Customers and you only display 20 records and most of the information you don't need is extremely wasteful
SELECT Companyname, Contactname FROM Customers WHERE CompanyName LIKE 'A%'" is a better approach.

SQL 2012 has a nice improvement
SELECT * FROM TableName ORDER BY id OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;

A good discussion: http://stackoverflow.com/questions/109232/what-is-the-best-way-to-paginate-results-in-sql-server
0
 

Author Comment

by:dvplayltd
ID: 39287758
To ve2ofa

My task is not to make paging. I get only the fields I need, my ask is - does any compression from SQL Server or libraries respondign for transfer data via internet is done? Read more detaily my question and you will understand.
0
 
LVL 79

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 39287797
There is no compression between the calling iis routine and the sql server, there can be compression (i.e. gzip) between iis and the web client. IIS/Aspnet only sends html data to the client.
0
 

Author Closing Comment

by:dvplayltd
ID: 39306416
10x for your time. My ask is not connected at all with IIS7 - my software connect directly via real IP to SQL Server. So we are talking for IP and SQL Server libraries - only these are involved.  But I guess the answer is the same - no any compression is done?
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A safe way to clean winsxs folder from your windows server 2008 R2 editions
An article on effective troubleshooting
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question