May 19, 2009 07:19 PM
Set-Based vs. Cursor-Based Solutions for Running Aggregates
Use cursors for large partitions
Rating:

(0)
SQL Server Magazine
InstantDoc ID #101736
Executive Summary:
SQL Server’s optimizer handles set-based solutions to running aggregates with quadratic complexity (n2)with respect to partition size, whereas it handles cursor-based solutions with linear complexity. So in terms of performance, when dealing with small partition sizesas many as a few hundred rows per partitionyou’re better off with a set-based solution. However, when dealing with large partitionsmore than 500 rowsyou’re better off with a cursor-based solution.
|
...
You must be a paid Professional Member to access this entire article.
Already a Professional Member? Please log in now: