Cursors: The Hidden Performance Problem

Michael Swart notes that cursor performance can be hidden from monitoring tools:

The OPEN statement is missing from sys.dm_exec_query_stats. I want to demonstrate that.

There are a few workarounds, and Michael even provides us a handy table, so read the whole thing.

Related Posts

Character Columns And MAX Vs TOP+ORDER Differences

Kendra Little digs into a tricky performance problem: Most of the time in SQL Server, the MAX() function and a TOP(1) ORDER BY DESC will behave very similarly. If you give them a rowstore index leading on the column in question, they’re generally smart enough to go to the correct end of the index, and […]

Read More

Row Goals And Anti-Joins

Paul White continues his row goals series: The optimizer assumes that people write a semi join (indirectly e.g. using EXISTS) with the expectation that the row being searched for will be found. An apply semi join row goal is set by the optimizer to help find that expected matching row quickly. For anti join (expressed e.g. using NOT EXISTS) the optimizer’s assumption is that […]

Read More


January 2016
« Dec Feb »