1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Performance comparison

Discussion in 'SQL PL/SQL' started by Bharat, Dec 6, 2015.

  1. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi All,

    In general, one of our query is taking 1 hour of time to run. And we are using this Query as one of the Cursor in PL/SQL Program and used it as cursor for loop. But this program is taking long time to run. So instead of using this cursor sql in for loop, can we load to table type variable and using this table type variable as loop makes performance better than cursor for loop ? Can anyone suggest on this.
     
  2. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    You have not provided sufficient details for me to say for certain that a PL/SQL table can be used, but I will tell you that most likely it is possible. A few years ago, I was responsible for improving the performance of an app that was performing large numbers of queries and comparing the results between each other in FOR loops. I used numerous associative arrays to handle the processing and achieved enormous speed improvements.
     
    Bharat likes this.
  3. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,351
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    As Matthew already stated you haven't provided enough information for a definitive answer, but it MIGHT be possible. This post shows one example of how that can be done:

    https://dfitzjarrell.wordpress.com/2012/02/27/collecting-thoughts/


    David Fitzjarrell
     
    Bharat likes this.