Search code examples
databasestored-procedurescursorsybase

How much slow are the cursors in Sybase


I have heard that cursors are very slow in Sybase, it is even said that we should avoid cursors. Can somebody tell how slow are the cursors in Sybase. Are read only cursors fine, or they are also very slow, and is it acceptable to use cursors altogether


Solution

  • http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc20020_1251/html/databases/databases537.htm

    here is your answer with example.... Sample execution times against a 5000-row table

    Procedure             | Access method                   | Time  
    ---------------------------------------------------------------------
    increase_price        | Uses three table scans          | 28 seconds  
    increase_price_cursor | Uses cursor, single table scan  |125 seconds