Link to home
Start Free TrialLog in
Avatar of dvplayltd
dvplayltdFlag for Bulgaria

asked on

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

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.
Avatar of Patrick Bogers
Patrick Bogers
Flag of Netherlands image

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.
Avatar of dvplayltd

ASKER

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.
Then the wrapper is the way to go.
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 ?
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
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.
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?