Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8392049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:25:10+00:00 2026-06-09T19:25:10+00:00

Does Oracle 11g optimize For Loops over arrays? If so how does it do

  • 0

Does Oracle 11g optimize For Loops over arrays?
If so how does it do it?

Example:
Does the following code treat each instance of lt_some_array(i) as a pointer to the record in the array at index i? Or, does it look it up every time?

FOR i IN lt_some_array.FIRST..lt_some_array.LAST
LOOP
   field1 := lt_some_array(i).field1;
   field2 := lt_some_array(i).field2;
   field3 := lt_some_array(i).field3;
   field4 := lt_some_array(i).field4;
   field5 := lt_some_array(i).field5;
   field6 := lt_some_array(i).field6;
   do_something();
END LOOP;

Clarification:
Does the compiler treat it like the following (where lr_some_row is a pointer and not a copy):

FOR i IN lt_some_array.FIRST..lt_some_array.LAST
LOOP
   lr_some_row := lt_some_array(i);
   field1 := lr_some_row.field1;
   field2 := lr_some_row.field2;
   field3 := lr_some_row.field3;
   field4 := lr_some_row.field4;
   field5 := lr_some_row.field5;
   field6 := lr_some_row.field6;
   do_something();
END LOOP;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:25:12+00:00Added an answer on June 9, 2026 at 7:25 pm

    Yes, Oracle 11g performs that optimization for you.

    That feature was added in 10g. See page 60 of the presentation “PL/SQL Performance – Debunking the Myths”. It includes an example very similar to your code. The manual optimization was almost twice as fast in 9iR2, but does not help at all in 10gR1.

    Although I can’t tell you how Oracle does it. As far as I know, that level of detail about how Oracle works does not exist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found out that Oracle Database 10g and 11g treat the following PL/SQL block
Does Pro COBOL 11g support the embedding of simple Oracle Locator Queries? For example:
On Oracle 9i, why does the following produce the result 'abc' select 'abc '
Does System.Data.OracleClient support oracle 11g? If yes which version? The .Net appplication is presently
I am using oracle 11g. I write code to connect oracle database with java
I've installed Oracle 11g and now I'm getting the following error when I try
Does anyone know why in Oracle 11g when you do a Count(1) with more
Oracle 11g SQL Server 2008 R2 I am receiving the following errors when trying
In Oracle (10g), when I use a View (not Materialized View), does Oracle take
Oracle does not support a bit datatype or any other type for true/false scenarios.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.