Solved

What is the use of bulk collect in oracle?

Posted on 2011-03-14
4
631 Views
Last Modified: 2012-05-11
What is the use of bulk collect in oracle?
how this increases performance?
0
Comment
Question by:sakthikumar
  • 3
4 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 35125973
bulk collect/fetch are used to fetch more than 1 record at a time.

For example, you can fetch 1000 records at a time into an array. If you fetch one record at a time, you need to fetch 1000 times to fetch all 1000 records where as with bulk collect/fetch you can just do it with one fetch.

Technically speaking, with one call to database you can fetch more than 1 record at a time by using bulk collect/fetch. If you are going to hit the database less number of times for fetching the data, then it obviously means the performance is going to increase right. You save time/resources right.
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 35125980
http://psoug.org/reference/array_processing.html  - for more information with examples.
0
 

Author Comment

by:sakthikumar
ID: 35136260
How can we say, it will go to db all the times, for eg. in a cursor,  the results will be in the memory or buffer right? and for every fetch, it need to get from memory only. correct or not?
0
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 500 total points
ID: 35136298
let us say you have a cursor declared but how do you traverse the record set in the cursor. You need to iterate a loop and for every iteration you fetch a record from the database. Only when loop iteration happens ( while using cursor for loops ) or fetch happens in the loop, the call goes to database to fetch the value.

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error executing command from server 6 49
Oracle - SQL Parse String 5 33
how to trim oracle sql sentence in unix 17 51
upgrading Oracle 10g/ 11g / 11g R2 to Oracle 12c 25 54
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question