PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.db.ms-sqlserver > Re: TDS and character encoding
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: TDS and character encoding

Réponse
 
LinkBack Outils de la discussion
Vieux 27/09/2007, 17h54   #1
bzh_29
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: TDS and character encoding


raymond_b_jime...@yahoo.com a écrit :
> I've seen a dump of the TDS traffic going from my webserver to the SQL
> Server database and it seems encoded in Unicode (it has two bytes per
> char). Seems it would have a huge impact on performance if it
> travelled in one byte. Why might this be?
>
> rj


Hi,
I've exactly the same trouble ... My apps is responding fine on a LAN
but when I goes on a WAN, getting horrible !

>From 5 sec to 7 min ... When I look SQL Time is the same so I look

network usage with network analyser and find the same result a you !

Something strange : in some case when string are in parameter it using
only one byte instead of two !

I'm wondering, if you find any solution ...

  Réponse avec citation
Vieux 27/09/2007, 23h41   #2
Erland Sommarskog
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: TDS and character encoding

bzh_29 (xiii29@free.Fr) writes:
> I've exactly the same trouble ... My apps is responding fine on a LAN
> but when I goes on a WAN, getting horrible !


If you run your application on a WAN, you need to be more considerate
with your design. Make sure you don't return unneeded columns in your
result set (no SELECT *!). Also make sure that you don't have a lot of
extra network roundtrips. If you need to find data for ten orders, run
one query not ten.

> Something strange : in some case when string are in parameter it using
> only one byte instead of two !


varchar data, I assume. Query text is sent as Unicode. Parameter values
in RPC calls are sent in their native format. So nvarchar will be Unicode,
varchar will be 8-bit chars, and an integer will be 4 bytes.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
  Réponse avec citation
Vieux 28/09/2007, 11h37   #3
bzh_29
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: TDS and character encoding


> If you run your application on a WAN, you need to be more considerate
> with your design.

Excatly. We're working since a long time to avoid any unneccessary
table or column.

> Make sure you don't return unneeded columns in your result set (no SELECT *!). Also make sure that you don't have a lot of extra network roundtrips. If you need to find data for ten orders, run one query not ten.


Request are build to return only needed columns and we use a package
analyser to see what's going on on network to optimize network
traffic.

It's with this analyser I see that when I send one byte in fact I send
two ... I understand the reason you explain before but as my apps will
never feet for japanese ou chinese needs, I'm a little sad to not be
able to avoir such things ...

Need to continue optimize every char I send ...

  Réponse avec citation
Vieux 28/09/2007, 14h52   #4
Bob Barrows [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: TDS and character encoding

bzh_29 wrote:
>> If you run your application on a WAN, you need to be more considerate
>> with your design.

> Excatly. We're working since a long time to avoid any unneccessary
> table or column.
>
>> Make sure you don't return unneeded columns in your result set (no
>> SELECT *!). Also make sure that you don't have a lot of extra
>> network roundtrips. If you need to find data for ten orders, run one
>> query not ten.

>
> Request are build to return only needed columns and we use a package
> analyser to see what's going on on network to optimize network
> traffic.
>
> It's with this analyser I see that when I send one byte in fact I send
> two ... I understand the reason you explain before but as my apps will
> never feet for japanese ou chinese needs, I'm a little sad to not be
> able to avoir such things ...
>
> Need to continue optimize every char I send ...


Ummm ... there is obviously something else going on here. You're trying to
tell us that sending two bites instead of one results in 84X (5 sec to 7
min) slower performance??? I don't think so. At worst, there would be a 2X
drop in performance, and even that is not likely (please, someone step in
and correct me if I'm wrong). My guess is an overloaded network or perhaps a
defective router or switch somewhere.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


  Réponse avec citation
Vieux 28/09/2007, 15h07   #5
Erland Sommarskog
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: TDS and character encoding

bzh_29 (xiii29@free.Fr) writes:
> It's with this analyser I see that when I send one byte in fact I send
> two ... I understand the reason you explain before but as my apps will
> never feet for japanese ou chinese needs, I'm a little sad to not be
> able to avoir such things ...


But maybe you need the oe digraph? Or the euro character? Those characters
are not on in Latin-1.

I don't know your business, but even if you are not aiming at the Far
Eastern market, you may expand into Poland or Hungary one day. That's
enough reason to use Unicode.

Developing for Unicode from the start is cheap. Changing to Unicode after
the fact is expensive.

And if you use varchar in your application, what is really your problem?
The only Unicode you need to send is the name of the stored procedures you
call? Or are you sending query batches from the application? Now, if you
do that, there are some bytes you can save by using stored procedures
instead.




--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
  Réponse avec citation
Vieux 28/09/2007, 15h34   #6
Roy Harvey (SQL Server MVP)
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: TDS and character encoding

On Thu, 27 Sep 2007 08:54:30 -0700, bzh_29 <xiii29@free.Fr> wrote:

>I've exactly the same trouble ... My apps is responding fine on a LAN
>but when I goes on a WAN, getting horrible !
>
>>From 5 sec to 7 min ... When I look SQL Time is the same so I look

>network usage with network analyser and find the same result a you !


Just to make sure one basic point is covered, do all the stored
procedures have SET NOCOUNT ON right at the beginning? Leaving that
out can magnify network issues.

Roy Harvey
Beacon Falls, CT
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h31.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15567 seconds with 14 queries