|
Posted by Hugo Kornelis on 11/21/07 23:05
On Wed, 21 Nov 2007 22:22:57 +0000 (UTC), Erland Sommarskog wrote:
(snip)
>One battle I have to fight in my shop is with colleagues who think that a
>"poor man's cursor" is better. And maybe sometimes it is. But having a
>loop where you do SELECT MIN() on a non-indexed temp table with 100000
>rows is definitely not.
Hi Erland,
Maybe it is, but I doubt it. After investigating the effect of options,
I wouldn't be surprised to find a way to beat a cursor with the default
options, since they are SLOW - but I have yet to see a "poor man's
cursor" that outperforms a _properly optimized_ cursor.
If your colleagues ever show you a way that they think beats a cursor,
please share it with me. Might make neat blog fodder.
Hmmm, maybe I'll do a sequel to the cursor episode anyway. The
misunderstanding is common enough to warrant some attention on my blog.
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Navigation:
[Reply to this message]
|