Abstract
It is very common to find database applications that use cursors to process one row at a time. Because data manipulation through a cursor in SQL Server incurs significant additional overhead, database applications should avoid using cursors. T-SQL and SQL Server are designed to work best with sets of data, not one row at a time. Jeff Moden famously termed this type of processing RBAR (pronounced, ree-bar), meaning Row By Agonizing Row. However, if a cursor must be used, then use a cursor with the least cost.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2012 Grant Fritchey
About this chapter
Cite this chapter
Fritchey, G. (2012). Cursor Cost Analysis. In: SQL Server 2012 Query Performance Tuning. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4204-8_14
Download citation
DOI: https://doi.org/10.1007/978-1-4302-4204-8_14
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-4203-1
Online ISBN: 978-1-4302-4204-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books