Skip to main content

Cursor Cost Analysis

  • Chapter
  • 1122 Accesses

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   44.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics