In part 1 of this mini-series, I explained what a rowgoal is and how it works to optimize a query with a TOP or FETCH expression. Part 2 then showed a few less obvious other cases where the optimizer might introduce rowgoals. In all cases so far, those rowgoals were beneficial. They helped the optimizer come up with the best execution plan for the number of rows requested.
Things can go wrong!
Unfortunately, there are cases where a plan that is optimized with a rowgoal turns out to be slower than without the rowgoal. The feature that is intended to make things go faster might actually slow your query down! Learn all about this in the video below!
More of me?
Was this useful to you? Do you want to learn more from me?
You can click here to see an overview of my scheduled conference visits. If you attend one of those, you get a lot of other presenters and sessions thrown in as well!
To learn really everything about SQL Server execution plans, check out my video training. Over 20 hours of super high quality video content (and more will be added when ready).
Or you can hire me, for instance for custom built in house training, or if you just want me to fix your performance problems now.



