Blog Post

Curb those Cursors !

,

With query performance becoming a constant battle, its often a forgotten fact that cursors should be avoided (in the majority of cases).

The SQL optimiser struggles when dealing with cursor ridden statements, when a FETCH command is executed, its moreorless the same as an extra SELECT command being executed.

Sometimes cursors are necessary, especially when executing stored procedures against separate records in a particular table. However, when it comes to using queries to return result sets, most of the time cursors can be avoided entirely. Use a more efficient set-based approach to solve your problem.

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating