A curious question posed itself when I was planning a new batch of additions to The Application(TM) (as in, the company-spanning behemoth). Having a result set for each row of which there needs to be a procedure called, is it more efficient to do the whole thing in MySQL by creating a procedure that loops a CURSOR and calls a procedure, or simply to fetch the set in PHP and do it "manually"? The procedure would run few times for a short duration (~1s for each call, around 2 - 3 calls per procedure, a few times per day).
The reason I'm asking this is that I'm wondering if anyone has any experience that CURSORS would be less efficient than the overhead of sending the data between MySQL and PHP multiple times. The other concern is that it uses one of the core tables, so I would like to minimize hits to it.