Most modern databases (including MySQL) are designed to perform set-based operations. The problem with cursors is that they perform string (or procedural) operations. Because of this, you will almost always see performance hit when you use cursors to complete a task that can be performed without cursors in a modern DBMS.
Take a look at this article , which does decent work on these two. It is written with SQL Server in mind, but most concepts apply.
source share