Explain in brief the cursor optimization tips.The following are the tips for cursor optimization:
1. When the cursor is not needed, close the cursor.
2. Deallocate the cursor after closing it.
3. Fetch less number of rows.
4. Avoid triggers, because trigger executes whenever data gets updated, leads to overload of the system.
5. When the rows are not need to update, use the option FORWARD ONLY.
6. Use WHERE clause instead of HAVING clause unless it is essential.
|