Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 1234»»»

Performance Effects of NOCOUNT Expand / Collapse
Author
Message
Posted Monday, December 04, 2006 9:29 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 9:35 AM
Points: 2,749, Visits: 1,407
Comments posted here are about the content posted at temp

LinkedIn Profile
Post #327697
Posted Monday, December 11, 2006 6:39 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 23, 2012 2:11 PM
Points: 3, Visits: 3

David,

Quite an interesting twist on some things you got used to.

In fact I put this statement in all my Stored Procedures.

However I do it (at least did) because of different reason. Back in time of ADO (NOT .Net) the returned message sometimes was treated as a Recordset along with the result you expected. Technically it was a collection of Recordsets, so you needed to fetch through in order to get what you really wanted. The message always was the first in that collection and could easily break the front end logic if you tried to refer some field by name, because message did not have any named fields. I remember several times I had a hard time troubleshooting the problem when someone "optimized" SP by removing/commenting "set nocount on".

I guess it is not a problem with ADO.Net though never put it in test if message adds any table in output Dataset. Indeed it is good to know that performance is better, though 3% boost can easily be eaten in a network environment. Also it is marginaly close to the "experiment error" - the difference in 8 and 9 (with ON) is about 1.5% itself.

Anyway it is not probably bad sometimes to re-evaluate some "good practice" recommendations just to get sense of them and understand a bit better the meaning and origines.

Thanks




Post #329420
Posted Monday, December 11, 2006 7:35 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 12:51 PM
Points: 201, Visits: 119
I would be interested to know if the discussions relative to specifying a default owner id are valid in a SS2005 environment. In SS2005 Logins are mapped to default schemas via a User Mapping. Seems like specifying default owners in the stored procs could actually cause problems if you want a Login to access tables with the schema specified in the User Mapping.

Can anyone clarify the SS2005 logic?
Post #329433
Posted Monday, December 11, 2006 7:54 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Wednesday, January 02, 2013 12:15 PM
Points: 1,443, Visits: 711

Excellent article!

I knew it increased performance setting nocount off; the fact that the performance increase is so slight is interesting....  I would have expected more of a performance increase.

Mark

Post #329442
Posted Monday, December 11, 2006 8:06 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, May 17, 2013 9:18 AM
Points: 772, Visits: 1,825

Great article with interesting points.  I'm going to have to run tests to see what impact this has on SQL Moblie.

David, as far as the owner thing goes I see one possible hole in how you set up your experiments.  You did the creates and tests with the same user.  More interesting would be to log on as dbo and do the create, then log on as a user and do the tests.  Often owner based object searches do the local logon first and then work up the tree.  Some start at the top of the tree and work down so that globally available objects come up first.



ATB

Charles Kincaid

Post #329467
Posted Monday, December 11, 2006 8:17 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, November 20, 2012 5:00 AM
Points: 103, Visits: 213

we had a situation where a job on a server was performing in a couple of minutes while on a remote pc (wan connected) it took 30+ minutes. changing this setting made the performance comparable with running on a server. the exact timings i dont remember but it was over 50% time reduction.

 

 

Post #329469
Posted Monday, December 11, 2006 9:33 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 1:03 AM
Points: 877, Visits: 185

Hi David,

That's a good article. Thank you very much for it - its good to have theories be tried and tested.

 

A couple of comments.

1) Is there there a reason you didn't run

DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE

on each iteration? I don't know if it would have made a difference or not - perhaps its worth trying out.

 

2) You've created four sprocs there. In the interests of a proper scientific experiment where one should control variables properly - you should make sure there is only one difference between the things you are testing, should you not? Well AddTestWithNoCount & AddTestWithoutNoCount have TWO differences. The former specifies NOCOUNT and does not specify a schema qualifier for the table. The second does not specify NOCOUNT but also DOES specify a schema qualifier. Hence - two differences. If you are testing the effect of NOCOUNT then shouldn't all other things be equal?

 

Minor points though. its a good article.

 

Thanks

Jamie


 



Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
Post #329503
Posted Monday, December 11, 2006 9:43 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, June 01, 2009 11:17 AM
Points: 371, Visits: 44
When first glancing at the performance chart, it appears that SET NOCOUNT ON is giving a 2-3x performance increase (that would be incredible news). Its not a good idea to "zoom" in to the top of a graph in these types of performance based articles. I would suggest showing the graph in its true form where the vertical range is from 0 to 4000 (instead of 3400-3700). The results of only a 3% increase will be alot more obvious then.
Post #329509
Posted Monday, December 11, 2006 9:50 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 1:03 AM
Points: 877, Visits: 185

Agreed - the graph is misleading in the extreme. That completely passed me by so thank you to Michael for point it out.

-Jamie

 



Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
Post #329511
Posted Monday, December 11, 2006 10:32 AM
SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: Moderators
Last Login: Tuesday, April 09, 2013 12:53 PM
Points: 8,357, Visits: 684

It increases slightly mostly because of the messages produced by

DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE

themselves. Looks like it adds a little more than a mintue to each run.

Also even thou it is fractional the savings wasn't just about time it has also been stated as reducing network overhead. But either way when you are trying to streamline your process and keep interaction speed high doing this is still a bennefit overall. Especially on servers with high loads.




Post #329523
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse