Direct insert Vs collection

Greetings,
In one of my procedures, I've used collection with commit every 1000 records. It took about 4 hrs to process 14,000,000 records. Then, without changing the logic, I've modified the same procedure and did direct insert and delete statements. It took about 1.5 hrs.
I was wrong thinking that collection would improve performance as they fetch all at the same time. Is this because of 'commit'? I have also experimented with commit every 10,000 records, even then it didn't improve much.
Could you discuss further on why slow Vs faster? Thank you,
Lakshmi

The rules of thumb (borrowed from Tom Kyte)
1) If you can do it in SQL, do it in SQL
2) If you can't do it in SQL, do it in PL/SQL. "Can't do it in SQL" generally means that you can't figure out how to code the logic in SQL and/or the business logic is so complex that it makes the SQL unreadable.
2a) If you have to use PL/SQL, try to use collections & bulk processing.
3) If you can't do it in PL/SQL, do it in a Java stored procedure
4) If you can't do it in a Java stored procedure, do it in an external procedure
Collections are never preferred over straight SQL from a performance standpoint, but they may be easier to code for more complex business rules.
Justin

Similar Messages

  • How to directly insert pictures inside a wiki page without the need to enter the picture's properties

    I am working on a publishing site collection using the enterprise wiki template. Add when I want to add a new Picture from my Pc to the wiki page, I will be prompted with the following dialog:-
    So can anyone advice how i can bypass this dialog and directly add the imag to the wiki page?
    i tried modifying the "Images" content type by hiding the above fields, but still i will be prompted to enter the following :-

    Hi,
    According to your post, my understanding is that you want to directly insert pictures inside a wiki page without the need to enter the picture's properties.
    Per my knowledge, you can use javascript to bypass Edit Properties Page while uploading pictures.
    Here are some similar articles for your reference:
    How to bypass Edit Properties
    Page while uploading documents in a document library
    How to bypass Edit Properties Page while uploading documents in a
    SharePoint and .NET: How to bypass Edit Properties Page or Skip EditForm.aspx Page while uploading documents in a document library
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • DIRECT INSERTS

    Dear forum,
    We can directly insert to table in bulk like
    insert into target as select * from source1 a,source_2 b where a.s1=b.s2
    From the perfomance itself we know that above is n't a record by record insert instead it is bulk insert .
    1) Experts pls tell me ..how oracle manages above query
    2)How many records it send to db @ a time
    Thanks

    hi keith,
    Pls see my query
    insert into pkg_tmp
    select           find_key(VALUE,8) ,
              (VL_ID)mod10 ,
              VALUE_ST     /* */     
    from
    SOURCE_ATTR d,
    STOCK c,
    CONTENT b ,
    PACKAGES a /* */
    where
    a.PACKAGE_ID = b.PACKAGE_ID
    and
         b.TP_ID =1
         and
         b.VL_ID = c.RRS_ID
    and
         c.RRS_ID = VAL_ID
         and
         ATTR_ID = 11
    Tables in from clause contains records in millions ( a = 33M ,b=37M,C=37M,D=122M)...
    I need to select the query as shown in query and finally result to be loaded into pkg_tmp table.
    Thanks..

  • Direct Insert path

    I want to insert large data from dblinks using direct insert however as rollback segment is quite small i need to commit after every 2000 rows or so.
    insert /*+ append */ into abc_monthly@dblink select * from abc partition(ODFRC_20040201);
    any help guys !
    or any other way round for faster insert than this ?
    Edited by: Avi on Aug 12, 2009 9:41 AM

    Hi,
    Don't shoot the messenger but your append hint will be ignored:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:549493700346053658

  • Insert large collections

    Oh great Oracle gurus...
    How do I insert into collections (varrays or nested tables) where I have more than 1000 members in the collection? I am having a problem where I have carefully built an insert statement which gathers up all the members of a collection and tries to insert them as a single statement. When I get a large number of members to the collection I am getting an error message ORA-00939: too many arguments for function.
    I assume that I can insert numerous times into a nested table but am not sure exactly how to do this (the samples in the documentation seem to be vague). However the documentation says that a varray must be inserted as a unit.
    Cameron

    Hi,
    The docs say an expression list can't contain any more than 1000 expressions, so I would guess this it the limit you'll be hitting here.
    However, in my testing I can't insert any more than 999 elements in a nested table using an expression list. With 1000 elements:
    [email protected](161)> create type nt_type is table of varchar2(10);
      2  /
    Type created.
    [email protected](161)> create table test (x int, y nt_type) nested table y store as test_y;
    Table created.
    [email protected](161)> @ed
      1  declare
      2     sql_stmt varchar2(32767);
      3  begin
      4     sql_stmt := 'insert into test (x, y) values (1, nt_type(';
      5     for i in 1 .. 999 loop
      6        sql_stmt := sql_stmt || '''hello'',';
      7     end loop;
      8     sql_stmt := sql_stmt || '''hello''))';
      9     execute immediate sql_stmt;
    10* end;
    11  /
    declare
    ERROR at line 1:
    ORA-00939: too many arguments for function
    ORA-06512: at line 9However, if I try to insert only 999 elements:
    [email protected](161)> ed
    Wrote file TEST.BRANDT_161_20070322212141.sql
      1  declare
      2     sql_stmt varchar2(32767);
      3  begin
      4     sql_stmt := 'insert into test (x, y) values (1, nt_type(';
      5     for i in 1 .. 998 loop
      6        sql_stmt := sql_stmt || '''hello'',';
      7     end loop;
      8     sql_stmt := sql_stmt || '''hello''))';
      9     execute immediate sql_stmt;
    10* end;
    [email protected](161)> /
    PL/SQL procedure successfully completed.
    [email protected](161)> select * from test;
             X Y
             1
    NT_TYPE('hello', 'hello', 'hello', 'hello', 'hello', 'hello
    ', 'hello', 'hello', 'hello', 'hello')
    [email protected](161)> select cardinality(y) from test;
    CARDINALITY(Y)
               999Maybe you could try a temporary table approach:
    [email protected](161)> delete from test;
    1 row deleted.
    [email protected](161)> create global temporary table gtt(y varchar2(10)) on commit delete rows;
    Table created.
    [email protected](161)> insert into gtt(y)
      2     select 'hello'
      3     from dual
      4     connect by level <= 2000;
    2000 rows created.
    [email protected](161)> insert into test(x, y) values (1, (select cast(collect(y) as nt_type) from gtt));
    1 row created.
    Elapsed: 00:00:00.07
    [email protected](161)> select cardinality(y) from test;
    CARDINALITY(Y)
              2000
    Elapsed: 00:00:00.01
    [email protected](161)> commit;
    Commit complete.
    Elapsed: 00:00:00.01
    [email protected](161)> select * from gtt;
    no rows selectedI must say, though... a nested table with more than 1000 elements sounds to me like it should just be a "table".
    cheers,
    Anthony

  • Biller Direct Integration with Collections Manangement

    Hi Experts
    I know the Biller Direct integration with Dispute management but not with collections management.
    Can anyone explain me the process / Steps of Integration  between Biller Direct and Collections Management?
    Thanks in advance
    Regards,
    Meenakshi.N

    Hi Meenakshi,
    There is no direct integration between Collections management and Biller direct.
    Cristobal.

  • Direct Insert or API

    I want to create/insert directly into CI_FUNCTION_ENTITY_USAGES (i$sdd_funent) by using appropriate values for all the not-null columns. I can see that ci_function_entity_usages.function_ref comes from ci_functions.irid,
    ci_function_entity_usages.entity_ref comes from ci_entities.irid, etc ...
    My question is : How do I populate ci_function_entity_usages.id,
    ci_function_entity_usages.irid, ci_function_entity_usages.ivid.
    Are they primed from some internal sequence or some pre-insert
    trigger somewhere?
    Is there a better way of doing this than using direct insert eg an api?
    Thanks in advance
    Ian

    At the moment I've no access to any Designer repository.
    The idea of API is that for each object there is individual PL/SQL package. For ci_function_entity_usages it should be ciofunction_entity_usage. In this package is type 'data' defined. It has 2 components: i and v. i is record of boolean variables. v is record of values - it maches ci_function_entity_usages view.
    To insert new function-entity usage you have to fill in data.v values and set data.i to true for elements you filled in in data.v. Then use ciofunction_entity_usage.ins procedure to insetr record.
    You do not have to set ID, ivid or irid - it is set by API.
    You can follow example.
    Hope it helps. Paweł

  • How to load data to a "clustered table" quickly?  direct insert not work

    We have a single hash clustered table whose size is 45G, and we used the command:
    insert /*+ append */ into t_hashed as select * from source.
    the source is about 30G, it takes a very long time(several days, and not yet completed).
    I dumped the redo log, and find there are lots of redo info about the insert. I have thought it should create much redo as it is "direct path insert", but from the dump info I could say the direct path insert didn't take effect.

    Your assessment is correct. INSERT /*+ APPEND */ does not work with a hash clustered table.
    If you think about how hash clusters work, and how direct load insert works, it should be clear to you why a direct load insert via the append hint can never work.
    How hash clusters work (well, only the part that's relevant to the current discussion):
    Initially, at creation time, the storage for the entire cluster is preallocated, based on the various cluster parameters you chose. Think about that. All the storage is allocated to the cluster.
    How direct load works (well, only the part that's relevant to the current discussion):
    Space already allocated to and used by the segment is ignored. Space is taken from free, unformatted blocks from above the high water mark.
    So, hopefully it's clear how these features are incompatible.
    Bottom line:
    It doesn't work, there's no way around it, there's nothing you can do about it....
    -Mark

  • Direct Rule - Add Collection Rule fails - SCCM Integration

    I am trying to use Add Collection Rule and add a computer to a collection using Direct Rule. It fails with the following error:-
    "Failed to add rule '"Comp1.dev.com"' to collection 'Test SCCM deployment'". Configuration Manager reported an error 'ConfigMgr Error Object:
    instance of SMS_ExtendedStatus
        Description = "Failed to parse WQL string SELECT * FROM SMS_R_System WHERE NetbiosName = \"\"Comp1.dev.com\"\"";
        ErrorCode = 1078464256;
        File = "e:\\nts_sccm_release\\sms\\siteserver\\sdk_provider\\smsprov\\sspobjectquery.cpp";
        Line = 1782;
        ObjectInfo = "SELECT * FROM SMS_R_System WHERE NetbiosName = \"\"Comp1.dev.com\"\"";
        Operation = "ExecQuery";
        ParameterInfo = "SELECT * FROM SMS_R_System WHERE NetbiosName = \"\"Comp1.dev.com\"\"";
        ProviderName = "WinMgmt";
        StatusCode = 2147749889;
    '. Details: The SMS Provider reported an error.
    But I am using Collection Value Type as Name and Resource Definition Value Type as "Resource Names". If I use Resource ID instead and add the computer resource ID - it works. The FQDN does not work.
    I have added quotes "comp1.dev.com" . the screenshot below is older.
    Regards, Vik Singh "If this thread answered your question, please click on "Mark as Answer"

    It does not matter what I name the rule. Only success is using the ResourceID, but then I will to write a powershell command to get the resource id.
    The Rule Definition has to be in quotes, else it says it is invalid. I have tried all combos and this does not work.
    Maybe someone else who has the IP can check.
    Regards, Vik Singh "If this thread answered your question, please click on "Mark as Answer"

  • How to insert into collection type of objects?

    Hello,
    Can any one help with the follwoing code below,where i cant insert into an instance of the table type within the pl/sql block.
    create type courselist is table of varchar2(25);
    create type student as object
    (name varchar2(20),
    courses courselist);
    create type student_typ is table of student;
    create or replace procedure test_nested as
    my_courses1 student_typ:=student_typ(student('harry',courselist('eco 2010','math 2010','acct 2010')));
    n_numb number;
    begin
    dbms_output.put_line('hello initial'||'-'||my_courses1.count);
    my_courses1.extend;
    n_numb:=my_courses1.next(my_courses1.first);
    dbms_output.put_line('Next Subscript :'||n_numb);
    dbms_output.put_line('hello after extend'||'-'||my_courses1.count);
    my_courses1(n_numb):=student_typ(student('Potter',courselist('eng 2010','bio 2010')));
    dbms_output.put_line(my_courses1(n_numb).name);
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end;

    Look at:
    my_courses1(n_numb):=student_typ(student('Potter',courselist('eng 2010','bio 2010')));my_courses1(n_numb) is of student type while student_typ(student('Potter',courselist('eng 2010','bio 2010'))) is table of student type. Change it to:
    my_courses1(n_numb):=student('Potter',courselist('eng 2010','bio 2010'));and you will be fine:
    SQL> create or replace
      2    procedure test_nested
      3      as
      4          my_courses1 student_typ:=student_typ(student('harry',courselist('eco 2010','math 2010','acct 2010')));
      5          n_numb number;
      6      begin
      7          dbms_output.put_line('hello initial'||'-'||my_courses1.count);
      8          my_courses1.extend;
      9          n_numb:=my_courses1.next(my_courses1.first);
    10          dbms_output.put_line('Next Subscript :'||n_numb);
    11          dbms_output.put_line('hello after extend'||'-'||my_courses1.count);
    12          my_courses1(n_numb):=student('Potter',courselist('eng 2010','bio 2010'));
    13          dbms_output.put_line(my_courses1(n_numb).name);
    14        exception
    15          when others then
    16            dbms_output.put_line(sqlerrm);
    17  end;
    18  /
    Procedure created.
    SQL> exec test_nested
    hello initial-1
    Next Subscript :2
    hello after extend-2
    Potter
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Cursor v/s direct insert

    hi all,
    which one is better...?
    defining a cursor for an insert or using the select stmt in the insert?
    ex1:
    declare cursor c1 as
    select a,b from table1
    begin
    for i in c1
    loop
    insert into table2 values i.a, i.b ;
    end loop;
    end;
    ex2
    begin
    insert into table2 values (select a, b from table1);
    end;
    thnks

    ...and here are the facts:
    SQL> set timing on
    SQL> declare
      2  cursor c is
      3  select *
      4  from all_Tables;
      5  begin
      6  for r in c loop
      7  insert into test values(
      8  r.OWNER                    ,
      9  r.TABLE_NAME               ,
    10  r.TABLESPACE_NAME          ,
    11  r.CLUSTER_NAME             ,
    12  r.IOT_NAME                 ,
    13  r.PCT_FREE                 ,
    14  r.PCT_USED                 ,
    15  r.INI_TRANS                ,
    16  r.MAX_TRANS                ,
    17  r.INITIAL_EXTENT           ,
    18  r.NEXT_EXTENT              ,
    19  r.MIN_EXTENTS              ,
    20  r.MAX_EXTENTS              ,
    21  r.PCT_INCREASE             ,
    22  r.FREELISTS                ,
    23  r.FREELIST_GROUPS          ,
    24  r.LOGGING                  ,
    25  r.BACKED_UP                ,
    26  r.NUM_ROWS                 ,
    27  r.BLOCKS                   ,
    28  r.EMPTY_BLOCKS             ,
    29  r.AVG_SPACE                ,
    30  r.CHAIN_CNT                ,
    31  r.AVG_ROW_LEN              ,
    32  r.AVG_SPACE_FREELIST_BLOCKS,
    33  r.NUM_FREELIST_BLOCKS,
    34  r.DEGREE             ,
    35  r.INSTANCES          ,
    36  r.CACHE              ,
    37  r.TABLE_LOCK         ,
    38  r.SAMPLE_SIZE        ,
    39  r.LAST_ANALYZED      ,
    40  r.PARTITIONED        ,
    41  r.IOT_TYPE           ,
    42  r.TEMPORARY          ,
    43  r.SECONDARY          ,
    44  r.NESTED             ,
    45  r.BUFFER_POOL        ,
    46  r.ROW_MOVEMENT       ,
    47  r.GLOBAL_STATS       ,
    48  r.USER_STATS         ,
    49  r.DURATION           ,
    50  r.SKIP_CORRUPT       ,
    51  r.MONITORING         ,
    52  r.CLUSTER_OWNER      ,
    53  r.DEPENDENCIES       ,
    54  r.COMPRESSION        ,
    55  r.DROPPED
    56  );
    57  end loop;
    58* end;
    SQL> /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:04.07
    SQL> insert into test
      2  select *
      3  from all_tables;
    3718 rows created.
    Elapsed: 00:00:01.07
    SQL> Regards,
    Gerd

  • Direct production in collective order network, automatic 261...

    hi all,
    i have a problem in a schenario with collective order network.
    i have order B part of collective order network of order A. and material of order B has special procurement key 52 maintained in it. and colletive order of goods movement is selected in order type setting of order B.
    now the problem is when i confirm the order B, its header material automatically gets issued to order A (as per the settings that is fine.. ).
    but when i canel \ reverse the order A, i can not see 262 for material of order B which was issued automatically....??? why so?
    and if i try to revrse order B,  it stucs in COGI with the error of deficit of sales order quantity (or unrestricted quantity)....
    can somebody tell me how to sollve this? how to get 262 of the header material of order B?
    best regards,
    Maulin
    Edited by: Maulin Munshi on Jun 17, 2009 8:27 AM

    If you're doing the confirmation of parent order (leading order) at header level (meaning you use CO15) then you can only confirm that particular order and not any child order. If you want the child orders to be confirmed also after completely confirming you'd have to change the control key of last operation of routing in leading material as milestone and use CO11 or CO11N and just confirm the last operation, it will automatically confirm all the operations in the leading order and all the sub orders (child orders). I don't think your OPKI setting will solve the issue.
    Production orders that belong to collective orders are generally confirmed like normal production orders. However, you should note the following:
        When you carry out a confirmation at header or suboperation level, you can only confirm the order concerned.
        When you confirm at operation level, you can confirm operations for all orders as long as you work with milestone operations or progress confirmations.
        When there is a confirmation in the collective order, the system sets the status CFCO (release occurred in network) at the header level of the leading order in the collective order.
    If you want to read more than what I mentioned, you go to this link

  • How to add books to a Collection directly

    The way the software seems to work, you add books to the library, then add them to a collection.
    This will not work for me, as I have thousands of books, all neatly sorted in directories. If I add them all, I will have to manually figure out which collection to put them in.
    Is there a way to add books directly to a collection?

    The following article gives instructions on how to create and add to collections on your Sony Reader:
    http://www.kb.sony.com/selfservice/micr ... 0226098574
    There currently is no method for converting a computer's folder structure to create collections on your Reader automatically, you will need to transfer the files first and then add them to collections.

  • Inserting the Brio Query Data into EIS OLAP Model  tables directly

    Dear Experts,
    Can someone please suggest how we can export data (result set records) from bqy files' queries into an EIS server's OLAP Model's tables?
    Right now I have a cube on Essbase server getting the data from excel sheets which store the data from the execution of .bqy files.
    Use of file system (excel sheets) has not been liked by my business users so now I need to avoid storing the data from brio queries into excel sheets for loading into the Essbase cube. This I am required to achieve using EIS/AIS so that the data from brio queries(.bqy files) can be directly inserted into Essbase cube with the help of (i.e. via) EIS/AIS.
    Any quick help would boost the life of this project of mine.
    Thank you,
    Vikas Jain

    user12072290 wrote:
    Dear Experts,
    Can someone please suggest how we can export data (result set records) from bqy files' queries into an EIS server's OLAP Model's tables?
    Right now I have a cube on Essbase server getting the data from excel sheets which store the data from the execution of .bqy files.
    Use of <A class=bodylinkwhite href="http://www.software-to-convert.com/h264-conversion-software/h264-to-quicktime-software.html"><FONT face=tahoma,verdana,sans-serif color=#000 size=1>file</FONT></A> system (excel sheets) has not been liked by my business users so now I need to avoid storing the data from brio queries into excel sheets for loading into the Essbase cube. This I am required to achieve using EIS/AIS so that the data from brio queries(.bqy files) can be directly inserted into Essbase cube with the help of (i.e. via) EIS/AIS.
    Any quick help would boost the life of this project of mine.
    Thank you,
    Vikas JainHave you got the answer? Would you pls post it here? 

  • Costs and Inventory posings in Direct Production / Collective order

    We are trying to implement direct production though collective orders functionalty at our client.
    We are using the right special procurement keys, order types (with collective order flag turned on) etc.  I am able to generate the collective order tree and also see that the scheduling is working as expected.
    However, when I post confirmation of child orders, I am  not seeing any goods movements in the leading orders.  Also, I donot see anycost in the leading order as well.   Has anyone come across this issue ?  Any thoughts / ideas willbe helpful?

    Hi,
    For the order type which you're using, go to OPJH & in the section Cost Controlling tick the check box which says Coll. order with goods movement
    Create a new collective order & carry out your cycle. I would suggest do a test in your sandbox first.
    Hope it clarifies.
    Regards,
    Vivek

Maybe you are looking for

  • Editing a JTable Feild (setValueAt)

    Hi, I have a series of tables that each pull different data from a database and then desplay the data to the user. The user has the ability to update the shown data by editing the field(s) displayed in the table. To complete the update, I want to err

  • IPhoto 6 library not seen by other iApps and 3rd party applications

    EVery since upgrading to iLife 6 my iPhoto library is not seen by iWeb, iMovie, ScreenSaver preference panel, PrintShop 2, etc. What I've tried: 1. Rebuilding all four options library 2. Deleting prefs 3. Repair permissions Any ideas on what else i c

  • HT1349 I bought a used ipad how do I register the serial number in my name

    I bought a used ipad how do I register the serial number in my name ???

  • 3D Line

    Hi, Can anyone help and point in the right direction. I would like to plot a line chart in 3D. I have x,y and z data points that would be imported with XML. My Flex programmers say they can't do it, but I am sure that Flex can allow a 3D line chart.

  • Releasing Blocked Sales Order

    Hi All, I need to create a report to show who released blocked sales order, The TCode for releasing sales Order is VKM1. I want to know after releasing order where this information gets stored. the changed person and the order values.. where I can fi