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 ««123»»

Optimizing Cursor Performance Expand / Collapse
Author
Message
Posted Tuesday, February 1, 2005 2:11 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, January 4, 2006 3:35 AM
Points: 31, Visits: 1
I realize that there is an implied authority there. I hate it, in fact I probably would use the words false advertising 'officially authorized Oracle Press' does not suggest to me that it is the name Oracle Press that has been authorized rather than the books content.



Niall Litchfield
Senior DBA
http://www.niall.litchfield.dial.pipex.com
Post #158707
Posted Tuesday, February 1, 2005 6:09 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, April 25, 2005 4:37 PM
Points: 5, Visits: 1

I always avoid cursors but they are, unfortunately, necessary sometimes. I did notice a huge difference between SQL7 and SQL2000. SQL7 would just fold in two as soon as you tried to run any cursor. SQL2000 gives acceptable performance as long as you don't over-use them.

I too, thought it was strange when I read that Oracle was supposed to be better with cursors in genral than MSSQL Server. Definitely not from my experience.

Post #158939
Posted Friday, February 4, 2005 3:21 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, April 25, 2005 4:37 PM
Points: 5, Visits: 1

WOW... I finally got around to checking some of my cursor code to make sure I was using those declaration flags he mentioned and sure enough I wasn't.

My sprocs executed reasonably fast anyway because I always prefetched data into a temp table and looped around that dataset instead of the production tables and I usually ran the sprocs late at night anyway so changing data never was a problem.

But the addition of the LOCAL and FAST_FORWARD enhanced performance dramatically (in some cases over 100 times faster). This makes a big difference to the more 'on demand' type of sprocs and sprocs with cursors call other sprocs with cursors (nested cursors! ick, I know). I am very pleased with all of my cursor executions now (but I still wouldn't use cursors in lieu of grabbing a data and processing it externally when I could)

Post #159822
Posted Monday, July 18, 2005 1:23 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 27, 2014 10:43 PM
Points: 4, Visits: 716
This article, http://www.sqlservercentral.com/columnists/kThaker/optimizingcursorperformance.asp
supposedly by Kalpesh Thaker, appears to be lifted almost word-for-word from Ken Henderson's book The Guru's Guide to SQL Server Architecture and Internals, published in 2003.
Post #202154
Posted Monday, July 18, 2005 3:11 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, December 5, 2014 8:45 AM
Points: 1,035, Visits: 412

I have several of Henderson's books but I don't have the one you refer to so I can't verify your statement myself.  Just a few thoughts though...

As a sometime autor myself, one of the things I have to struggle with is the fact that almost everything that needs to be written about SQL Server already has been written in some form or another.  Between Books Online and the myriad of third party books including excellent titles by people like Kalen Delaney, Ken Henderson, Joe Celko, Chris Date etc... I can hardly think of any areas that are not pretty well covered.  Almost anything I can say is merely a rephrasing of what has already been said.

I made a concious decision to wade in (at least up to my knees) and attempt to bring something of value to the community.  I applaud others that have made the same decision even if our efforts might be somewhat deficient owing to the fact that I am not a professional writer and do not have the benefit of editors and proofreaders etc... 

That said, there is certainly a world of difference between using ideas that have been expressed elsewhere and expressing them in your own language (hopefully recombining them and adding clarity and/or emphasis) and ripping off the work of another person.  Ideas and concepts can't be patented or copyrighted, but the process or syntax of expressing those ideas can.

Unless the article is truly a word for word copy (or nearly so) of Henderson's work, Kalpesh Thaker ought to be given the benefit of the doubt.




/*****************

If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek



*****************/
Post #202189
Posted Monday, July 18, 2005 7:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 27, 2014 10:43 PM
Points: 4, Visits: 716
I'm sure Kalpesh Thaker is a nice person, and I realize that there are only so many ways of describing the same information, particularly in an article such as the one in question. I would like to post Ken Henderson's original text here so that you can see what I am talking about, but that would actually put me in violation of his copyright because I don't have permission from the publisher. But it is widely available, so you can check for yourself. In any case, there is no benefit of the doubt, for there is no doubt. Thaker's article is a virtual copy, with nearly identical syntax and a substitution every other sentence or so that doesn't change the meaning. It wouldn't have taken him much longer to write his own article than it probably took him to type it in while reading it from the book -- *maybe* he saved himself an hour or two. Even the sample SQL at the end has been ripped off. It's plagiarism at a high school level. Too blatant for my taste, and that's why I said something.
Post #202226
Posted Tuesday, July 19, 2005 9:12 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, December 5, 2014 8:45 AM
Points: 1,035, Visits: 412
I think that I'll check it out then.  Do you have a page number that I can reference so I don't have to search around?  If this is the case then the editors of this site need to know that they have posted copyrighted material...


/*****************

If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek



*****************/
Post #202407
Posted Tuesday, July 19, 2005 10:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 27, 2014 10:43 PM
Points: 4, Visits: 716
pp. 569-571 in my copy -- the section entitled 'Optimizing Cursor Performance'. There *are* 2 or 3 sentences that contain information that is -in addition- to the information plagiarized from the Henderson article, but the Henderson article is present in its entirety.
Post #202463
Posted Tuesday, July 19, 2005 12:08 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, December 5, 2014 8:45 AM
Points: 1,035, Visits: 412

Tyler, I had a chance to check this out and you are absolutely correct.  I'll let Steve Jones know.




/*****************

If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek



*****************/
Post #202507
Posted Wednesday, July 20, 2005 10:32 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 27, 2014 10:43 PM
Points: 4, Visits: 716
thanks dcpeterson. sorry to be the bearer of unpleasant tidings.
Post #202834
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse