What is the difference between pls_integer index and index of directory for a collection?

Hi all

I have a bit of difficulty understanding the difference between pls_integer and directory when you declare a collection...

Is not so much pls_integer than the supposed to be the same in 10g and 11g?

My problem is that I've declared a collection in a procedure with directory and by record type, it takes 10 seconds to process. (IE TYPE test_table IS the TABLE OF test % rowtype directory INDEX ;))

However, the same procedure with the declared collection with index of pls_integer, take only 1 second to process. (IE TYPE test_table IS the TABLE OF test % rowtype INDEX BY PLS_INTEGER ;))

Any help would be welcome.

Thank you.

MichaelR wrote:

I don't understand when say you not to use DML in a LOOP and use sql only. Can you please give me an example?

I usually of code like this:

  1. I'm looped slider
  2. Update table_name
  3. the value of col1 = i.rec1
  4. where col2 = i.rec2;
  5. end loop;

This approach is incorrect.

All SQL is parsed and executed as SQL cursors. There is no such thing as use SQL or cursor.

A cursor is a "compiled SQL program. Source SQL that has been analyzed in a cursor executable code. When you retrieve the cursor, you push the button the cursor or program execution. It finds a row and return lines. He's on a break. You get the rows returned, these processes and then click the button run the cursor using fetch. Until the cursor/program finds no additional data (or he faces a snapshot too old for example, where it can not rebuild a coherent reading to find the next set of lines).

A cursor is and has never been a set of cached data in memory that you are recovering from.

Take a look at your code. You use a slider/program to retrieve data from the database. For each row in the cursor returned, you call another slider/program and pass this line as input data.

It's slow. Data line moves a cursor to your PL/SQL code, and then again from your PL/SQL code to another cursor.

A single slider that makes the reading (the SELECTION cursor) part and the part of writing (the slider to UPDATE), requires no PL/SQL to read and write the parts together.

How to write this unique SQL cursor? You can use:

UPDATE (SELECT... Of... JOIN THE... WHERE...) SET...

You can use the MERGE statement. Or maybe just a statement UPDATE simple vanilla.

What is the problem of a conceptual, performance and scalability point of view, is the approach that you have indicated above. That approach will ALWAYS be slower than just SQL. This approach cannot scale.

The mantra of performance for Oracle is simple: Maximise SQL . Minimize the PL/SQL.

Use the SQL language correctly and properly. Do not what SQL is designed to do, in PL/SQL.

Tags: Database

Similar Questions

  • What is the difference between associative arrays and nested tables?

    Hello
    What is the difference between associative arrays and nested tables?

    nested tables cannot be indexed by other than pls_integer and unlike nested tables table associative cananot be declared at the schema level.

    is there any other difference set apart from the diff above 2?

    user13710379 wrote:
    What is the difference between associative arrays and nested tables?

    Name-value pairs (associative) against a list of values (table standard/nested table).

    nested tables cannot be indexed by other than pls_integer

    They are not "indexed" the way in which an associative array is indexed. A standard table is referenced by the position of the cell in the table. This position is essentially the offset of the memory of the cell from the start address of the table.

    Can not solve a cell in an associative array directly via a memory offset index. You place a cell reference value it by his 'name' (a search in the linked list/hash table).

    The following example shows the difference between the pairs of name / value and a list of core values.

    SQL> declare
      2          --// associative arrays are NAME-VALUE pairs
      3          type TArr1 is table of varchar2(10) index by pls_integer;
      4          type TArr2 is table of varchar2(10) index by varchar2(10);
      5
      6          arr1    TArr1;
      7          arr2    TArr2;
      8  begin
      9          arr1(100) := '1st entry';
     10          arr1(1) := '2nd entry';
     11          arr1(5) := '3rd entry';
     12
     13          arr2('john') := 'New York';
     14          arr2('jane') := 'Paris';
     15          arr2('jack') := 'London';
     16
     17  end;
     18  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL>
    SQL> declare
      2          --// standard arrays are lists
      3          type TArr3 is table of varchar2(10);
      4          type TArr4 is table of number;
      5
      6          arr3    TArr3;
      7          arr4    TArr4;
      8  begin
      9          arr3 := new TArr3( '1st entry', '2nd entry', '3rd entry' );
     10
     11          arr4 := new TArr4( 100, 1, 5 );
     12  end;
     13  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    
  • What is the difference between an application and a widget?

    I'm a newbie trying my Tablet cleaning. to start:

    What is the difference between an application and a widget?

    Widget-based applications

    not always asked of widgets

    Widget is just an application interface to develop android home and have some readily available settings/info/etc.; If you do not need to type an application to access some of the data; but you can type the widget to run the application if necessary and if possible.

    It's like a windows program, you must run it to use it... If they is not a widget.

  • What is the difference between photo gallery and Webcam live live moviemaker

    What is the difference between photo gallery and Webcam live live moviemaker

    Post Windows Live questions in the appropriate forum found here:
    http://windowslivehelp.com/

  • What is the difference between Foglight JavaEE and Foglight JMX monitoring?

    Hello

    I have a plan to monitor the 6.1.0.17 WebSphere Application Server (32 bit) and 7.0.0.5 (64-bit)

    But I understand not all Foglight for JavaEE and Foglight for JMX.

    Foglight for JavaEE or Foglight for JMX is able to monitor WebSphere?

    What is the difference between Foglight JavaEE and Foglight JMX monitoring?

    Thanks in advance

    Jeans

    Just to add to the excellent answers already posted.

    We have 2 agents which allows you to monitor Java:

    1. a JavaEE agent that runs inside the JAVA virtual machine and the information of both JMX and instrumentation.

    This Agent will give you JMX information like information of JVM (use of the bunch, son etc.), of the Application and server availability information and other information of JMX/PMI (connections pools, pools of ejb, servlets, jsp, JCA and more).

    Java EE & # 039agent also gives you information of the instrumentation - RFA count and response time, exceptional output and timeout information, distribution of queries (App/DB, component technology, server, application failure), object tracking, transaction flow and stransactional between servers and data sources) and ask traces (the ability to see the trees of the RFA at the method level to know where things are slow/stuck).

    2 JMX agent is running outside the JVM but can run on the same computer or on a remote computer, this agent requires access active, JMX. This agent gives you information JVM, availability server/applications, as well as some data as the application server published using JMX (pools of connections, JCA, EJB, servlets, etc.). The JMX agent also gives you the ability to see a list of the mbeans, get the data they expose (javaEE agent gets only a predefined list (same list that is used as a template for the application servers in the JMX agent)).

    Hope this helps

    Golan

  • What is the difference between NET USE and MOUNT? Why do they work differently?

    What is the difference between NET USE and MOUNT?  Why do they work differently?

    Hello

    Thanks for posting your query on the Microsoft Community.

    According to the description, I understand that you have a query.

    I suggest you re-post your query on The TechNet Forums because we have experts working on this type of questions and for you help the better.

    Check out the link:

    https://social.technet.Microsoft.com/forums/Windows/en-us/home?category=w7itpro

    You may consult:

    https://TechNet.Microsoft.com/en-us/library/bb490717.aspx?f=255&MSPPError=-2147217396

    Hope this information helps. Please let us know if you need any other help with Windows in the future. We will be happy to help you.

  • What is the difference between. MHT and. HTM?

    Original title: is anyone know about MHT files?

    What is the difference between. MHT and. HTM?

    Hi Sheryl,

    Welcome to the Windows 7 community!

    I understand that you would like to know the difference between file MHT and HTM file. I'm happy to help you.

    MHTML, short for MIME HTML, is a format to archive web page used to combine resources that are usually represented by external links (such as images, Flash animations, audio files, Java applets) as well as the HTML code in a single file. The content of an MHTML file is encoded as if it were an email message to HTML, using the MIME type multipart/related. The first part of the file is normally encoded HTML; subsequent parts are additional resources identified by their URL original and encoded in base64. This format is sometimes referred to as MHT, after the suffix .mht given to these files by default when created by Microsoft Word, Internet Explorer or Opera. MHTML is a proposed standard, distributed in an edition revised in 1999 as RFC 2557.

    HTML Web page that is used by Web browsers; contains the code markup that is stored in a plain text format; used to display and format the text and images in a Web browser.

    HTM files serve the same exact than purpose. HTML files. The extension ".htm" appeared with the use of the Web Microsoft, such as FrontPage, SharePoint Designer and Expression Web development software.

    HTM files are much less common than HTML files.

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

     

     

    Kind regards!

  • BlackBerry 10 What's the difference between BB10 London and Liverpool?

    What is the difference between BlackBerry London and Liverpool BlackBerry? I have a hard time with this.

    Thank you!

    The only difference is the radio within each bands...

  • What is the difference between native SDK and Cascades/qt?

    Hi all

    Can someone tell me what is the difference between native SDK and Cascades/QT?

    When I need to go to NativeSDK and when I go to waterfalls?

    These two works in BB 10 or only Tablet?

    Please delete me, I can't live without knowing this.

    Thanks in advance.

    Hi Smiley,

    Yes, you need to install the two NDKs. They coexist and separate IDEs and install files.

    See you soon

    Swann

  • What is the difference between Unicast RPF and Reverse Path Forwarding?

    I am confused between Unicast RPF and Reverse Path Forwarding function.

    What is the difference between Unicast RPF and Reverse Path Forwarding?

    Because they have all two please check the address of the source of each package before sending it to the destination too?

    Reverse Path Forwarding is used only when the network want to build a tree shared multicast communication and then we must use Unicast RPF after creation of the shared tree?

    The mechanism of the RPF is mainly used to ensure no loop of routing traffic.

    As you probably already read, it does by ensuring that his route to the source address of a packet received is accessible via the same interface that the packet is entered in the. Think of the notion of "root port" in STP. all root ports are similar to the root, sunflower follow the Sun. Therefore, it is naturally a loop prevention mechanism.

    With multicast traffic, it is quite likely to create multiple loops of routing the nature of 'destination' traffic. For this reason, using a mechanism as the RPF to ensure you are on the "road to the root" (to say) to the source originating multicast traffic. Otherwise if you're not then you either receive this traffic route in a loop, or a suboptimal path.

    uRPF works essentially the same way, except that it is done for unicast traffic instead. Now with unicast traffic your flow is from a source and directs to a single destination. Given that, as the fact that you are using a dynamic routing algorithm (which allows to select the path to a destination), you can have loops of your network for unicast traffic flow routing; of course there may be exceptions to pitfalls of configuration route redistribution.

    However RPF when it is applied to traffic unicast can add another advantage, and it's verification IP source. That's why we can use it as a security mechanism to ensure that data are from where it is supposed to come.

    On the limit of the L2, you then have mechanisms such as guard source IP to ensure that the correct host is not usurpation of their IP address.

    By analogy RPF can be used for checking at source for multicast traffic, and it is intrinsically that however, the most important role is so that it can be used to guarantee without loop routing of multicast traffic.

    I hope that helped clear things upwards and not confused you any more with all this.

  • What is the difference between windows live and office live?

    What is the difference between windows live and office live?

    RM

    Windows live mail is a free email client.  Microsoft office Outlook is a complete recommended paid e-mail application.

  • What is the difference between a folder and a Briefcase. How can I create a new foler in a Briefcase?

    What is the difference between a folder and a Briefcase. How can I create a new foler in a Briefcase?

    This is just n his own when I wanted to create a new folder, right-click in an empty area and the icon associated with a Briefcase appeared. I'm not familiar with this notation or the form of file storage

    Thanks for the reply

    New folder is missing.
     
     
    How to remove and restore the default context Menu items 'New' in Windows 7 and Windows 8
    http://www.SevenForums.com/tutorials/28677-new-context-menu-remove-restore-default-menu-items.html
     
     

    Tip: When you save the text in Notepad, the default file format is .txt. Replace all files.
     
     
     

     
  • What is the difference between Windows 7 and Windows 7 Starter?

    Original title: "what is the difference between Windows 7 and Windows 7 Starter? I want to install Windows on a laptop... I noticed that some of them offer Windows 7 and others offer Windows 7 Starter.  What is the best, most complete? »

    What is the difference between Windows 7 and Windows 7 Starter?  I want to install Windows on a laptop... I noticed that some of them offer Windows 7 and others offer Windows 7 Starter.  What is the best, most complete?

    On Tuesday, November 9, 2010 22:52:15 + 0000, cvzimbaldi wrote:

    When it says that windows 7 Home premium is an upgrade to windows 7 starter edition, means that the home premiun cannot upgrade Vista?

    I do not understand the question above, but to answer your question in
    the subject line, "what's the difference between Windows 7 and.
    Windows 7 Starter? "the Windows 7 Starter Edition is not another
    operating system, it's just kind of Windows 7. And it is the lowest
    level editing, so you can pass her to another level such as
    Windows 7 Home Edition.

    Ken Blake (MS-MVP)

  • What is the difference between codec primary and secondary codec in cts-3000?

    Hello

    I'm a novice on telepresence. This community is only a place to resolve issues for me.

    What is the difference between codec primary and secondary codec in cts-3000?

    I know the primary function of the codec. but I don't know exactly of secondary function of codec.

    Help me please.

    Hello

    On a CTS 3000 system, you have 1 codec primary and secondary 2 codecs. Secondary codecs are responsible for the camera left and right and view the connections. They communicate the main codec via an Ethernet cable.

    Here is a guide to the installation of a CTS-3000 so that you can see the routing of cables.

    http://www.Cisco.com/c/en/us/TD/docs/Telepresence/cts_3000/guide/3000_assembly_guide/CH08_Routing_Power_and_Signal_Cables.html

    In addition, if you are interested to learn more about the telepresence as of last year, Cisco introduced the video CCNA certification track. Maybe it's something you are interested in.

    https://learningnetwork.Cisco.com/community/certifications/ccna_video

    PEI

  • What is the difference between x 86 and x 64-bit windows?

    What is the difference between x 86 and x 64-bit windows?
    Why windows 8 is incompatible with the office that is capable of windows 7?

    Title: Original Windows 8.0 and 8.1

    The terms (x 86) 32-bit and 64-bit (x 64) refer to how a processor (also called a CPU), processes the information. The 64 bit version of Windows handles large amounts of RAM (RAM) more efficiently than a 32-bit system.

    You can try to install a 64-bit version of Windows 8 on a 32-bit version of Windows 7. You must use the 32-bit disc instead.

    Learn more about the upgrade:

    The upgrade from Windows 7 to Windows 8

    also:

    http://techingiteasy.WordPress.com/2013/02/14/how-to-migrate-from-32-bit-versions-of-Windows-to-Windows-8-64-bit/

Maybe you are looking for

  • Some rules don't work

    HelloI use mac Mail and create rules to block unwanted emails. But sometimes these rules do not work.Today I get an email that is most suborn one I've ever seen.1. I copied the address of the sender ([email protected]) and created a rule "If contains

  • What is the best method to do a clean install of El Capitan (currently using Mavericks).

    I want to do a clean install of El Capitan. I am currently using Mavs 10.9.5 and my time machine goes back to 2010. I don't want to migrate everything. I want to start cleaning up. I read a few methods, but I'm curious to know if there is some consen

  • Satellite L300 - how to use and install Bluetooth?

    Hello world. I would like to know how can use bluetooth and how to install it on my:Satellite L300-204 SYSTEM UNITmodel No.: PSLB8E - 06100ES4 It is necessary to transfer pictures from my samsung mobile phone TKS a lot.Kind regards. Ornella

  • Support to Android

    Featured application - would like to have the support of android wear so I can use Apple music during the race without having to carry my phone.

  • I need windows live messenger music plugin

    I can not play the radio on the internet with the Windows live messenger music plugin and it bothers me